H2 Console in versions between 1.1.100 and 2.0.204 is vulnerable as it allows loading of custom classes from remote servers through JNDI, like the Log4Shell vulnerability. Let’s see in detail the issue and how this can affect our environment.
Here is a cheat sheet for H2 Database which shows some common Data definition, Data modification statements, JDBC Settings and H2 Database server administration. Firstly, if you are looking for an introduction to using H2 Database in your applications, then check this tutorial: H2 database tutorial DDL cheat sheet Table Creation (Basic) CREATE TABLE TEST(ID … Read more
A DataSource is the preferred means of getting a connection from a Database. Let’s learn how to fetch the list of Datasources which are configured in the application server using the CLI and programmatically.
A JDBC Driver is able to call standard SQL statements into the vendor-specific database protocol. In this tutorial we will learn how to download and install a JDBC Driver on WildFly / JBoss EAP 7.
To inject a Datasource in your Enterprise applications you can use the javax.annotation.Resource annotation to declare a reference to that resource. The @Resource can decorate a class, a field, or a method. The container will inject the resource referred to by @Resource into the component either at runtime or after its initialization. In the following … Read more
When connecting WildFly / JBoss EAP to a Database cluster you need to provide an appropriate JDBC Connection String. We’ll examine three popular Database: Oracle, MySQL and PostgreSQL. Oracle Real Application Clusters (RAC) Oracle Real Application Clusters (RAC) is a software component you can add to a high-availability solution that enables users on multiple machines … Read more
WildFly and JBoss EAP 6/7 no longer support remote JNDI lookup of datasource objects. If you attempt to lookup a Datasource object from a remote client, the following error will be thrown: ERROR: org.jboss.remoting3.MessageCancelledException Exception in thread “main” org.jboss.naming.remote.protocol.NamingIOException: Failed to lookup [Root exception is java.io.NotSerializableException: org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] As an alternative, it is recommend using an … Read more
Data source definitions can be also packed in your application so that you don’t have to modify at all the server configuration. When deploying data source on WildFly as part of your application you have to add them in a specific folder, which varies depending on the application package format. For example, for a Web … Read more
In this article we will learn how to configure Connection Properties in a JBoss / WildFly Datasource. Let’s step back first. To configure Connection Pooling (non-XA) to a Database you have two options: Using a class which implements java.sql.Driver Using a class which implements javax.sql.DataSource When using a Class which implements java.sql.Driver, you can simply … Read more
Have you got No ManagedConnections available error message ? … javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:jboss/datasources/MyDataSource … javax.resource.ResourceException: IJ000655: No managed connections available within configured blocking timeout (30000 [ms]) In this tutorial we will learn which are the possible causes to this problem. # 1 Your connection pool is too small Increase … Read more