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"> ...

Get Mastering JBoss Enterprise Application Platform 7 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.