This example uses the MySQL JDBC driver version 8.0.13.
- Download the JDBC driver.
- SSH to the server. Navigate to /opt/jboss-as/modules/com/apc/etl/
-
Create the directory mysql-8_0_13 with the command:
mkdir mysql-8_0_13
-
Navigate to mysql-8_0_13 and create the directory main with the command:
mkdir main
-
Navigate to main and create the module.xml file with the command:
vi module.xml
- Save the module.xml file and exit.
-
Paste the following into the module.xml file:
Note: This is the contents of the module.xml file from postgresql, in the directory /opt/jboss-as/modules/com/apc/etl/postgresql/main/<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.0" name="com.apc.etl.postgresql">
<main-class name="org.postgresql.Driver"/>
<properties>
<property name="dialect" value="org.hibernate.dialect.PostgreSQL94Dialect"/>
<property name="driverclass" value="org.postgresql.Driver"/>
</properties>
<dependencies>
<system/>
<module name="javaee.api"/>
</dependencies>
</module>
-
Change all properties where the postgresql driver is mentioned. When you are finished, your module.xml file should look like this.
<?xml version="1.0" encoding="UTF-8"?>
` <module xmlns="urn:jboss:module:1.0" name="com.apc.etl.mysql-8_0_13">
<main-class name="com.mysql.cj.jdbc.Driver"/>
<properties>
<property name="dialect" value="org.hibernate.dialect.MySQLDialect"/>
<property name="driverclass" value="com.mysql.cj.jdbc.Driver"/>
</properties>
<dependencies>
<system/>
<module name="javaee.api"/>
</dependencies>
</module>
- Copy the JDBC driver .jar file from the downloaded location to the server.
You can use the scp command, for example, <download location>/mysql-connector-java-8.0.13/mysql-connector-java-8.0.13.jar <username>@<SERVERIP>:/tmp
- Move the .jar file from the /tmp folder to /opt/jboss-as/modules/com/apc/etl/mysql-8_0_13/main/
- Navigate to /opt/jboss-as/modules/com/apc/etl/module/
- Open the module.xml file.
- Add <property name="mysql-8_0_13"/> to the <properties> section.
-
Add <module export="true" name="com.apc.etl.mysql-8_0_13"/> to the dependencies section.
When you are finished, your module.xml file should look like this.<?xml version="1.0" ?>
<module xmlns="urn:jboss:module:1.1" name="com.apc.etl">
<properties>
<property name="postgresql"/>
<property name="jtds-1_3_1"/>
<property name="mysql-8_0_13"/>
</properties>
<resources/>
<dependencies>
<module export="true" name="com.apc.etl.jtds-1_3_1"/>
<module export="true" name="com.apc.etl.mysql-8_0_13"/>
</dependencies>
</module>
-
Restart the DCO server with the command:
systemctl restart operations
0 comments
Please sign in to leave a comment.