Configuring a JDBC 4-compliant driver
Before configuring the driver, we need to create a custom base directory to store our configuration, and run the instance with the flag --admin-only
, as follows:
cp -a standalone mysql ./bin/standalone.sh -Djboss.server.base.dir=mysql --admin-only
Now, in a new terminal window, connect to CLI, and issue the following command:
/subsystem=datasources/jdbc-driver=mysql:add(driver-name=mysql,driver-module-name=com.mysql,driver-xa-datasource-class-name=com.mysql.jdbc.jdbc2.optional.MysqlXADataSource,driver-class-name=com.mysql.jdbc.Driver)
The previous command will add the specified driver to the list of available drivers in the datasource subsystem. Here it is for reference:
<subsystem xmlns="urn:jboss:domain:datasources:4.0"> <datasources> <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true"> <connection...