6.2.2. Install a JDBC Driver as a Core Module


Before performing this task, you need to meet the following prerequisites:

Procedure 6.2. Task

  1. Create a file path structure under the EAP_HOME/modules/ directory. For example, for a MySQL JDBC driver, create a directory structure as follows: EAP_HOME/modules/com/mysql/main/.
  2. Copy the JDBC driver JAR into the main/ subdirectory.
  3. In the main/ subdirectory, create a module.xml file similar to the example below:

    Example 6.1. Example module.xml file

    <?xml version="1.0" encoding="UTF-8"?>
    <module xmlns="urn:jboss:module:1.0" name="com.mysql">
        <resource-root path="mysql-connector-java-5.1.15.jar"/>
        <module name="javax.api"/>
        <module name="javax.transaction.api"/>
    The module name, com.mysql, should match the directory structure for the module.
  4. Start the Server.
  5. Start the Management CLI.
  6. Run the following CLI command to add the JDBC driver module as a driver:

    Example 6.2. Example CLI Command


The JDBC driver is now installed and set up as a core module, and is available to be referenced by application datasources.