Java Reference
In-Depth Information
• JBOSS_HOME/modules/com/mysql/main/module.xml
If you are using a Linux shell, enter the following commands:
cd $JBOSS_HOME
mkdir modules/com/mysql
mkdir modules/com/mysql/main
Now, in the main folder, add a file named module.xml . This file contains the actual
module definition—the most interesting part of it is the module name ( com.mysql ),
which corresponds to the module attribute defined in your data source.
Next, you need to state the path to the JDBC driver resource and finally the module
dependencies.
<module xmlns="urn:jboss:module:1.0"
name="com.mysql">
<resources>
<resource-root
path="mysql-connector-java-5.1.24-bin.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
We are done with the module installation. Now we need to define a data source
in our configuration that will use this module and hold a pool of connections to
our MySQL database. In order to do this, you can edit standalone.xml/do-
main.xml , adding a driver element into the data source's subsystem.
<subsystem
xmlns="urn:jboss:domain:datasources:1.0">
<datasources>
<datasource jta="false"
Search WWH ::




Custom Search