Deploying Connector/MXJ within JBoss
For deployment of Connector/MXJ within a JBoss environment, you must configure the JBoss environment to use the Connector/MXJ component within the JDBC parameters:
- Download Connector/MXJ and copy the
mysql-connector-mxj-gpl-[ver].jarfile to the$JBOSS_HOME/server/default/libdirectory.If you are using Connector/MXJ v5.0.4 or later, also copy the
mysql-connector-mxj-gpl-[ver]-db-files.jarfile to$JBOSS_HOME/server/default/lib. - Download Connector/J and copy the
mysql-connector-java-file to the5.1.5-bin.jar$JBOSS_HOME/server/default/libdirectory. - Create an MBean service xml file in the
$JBOSS_HOME/server/default/deploydirectory with any attributes set, for instance thedatadirandautostart. - Set the JDBC parameters of your web application to use:
String driver = 'com.mysql.jdbc.Driver'; String url = 'jdbc:mysql:///test?propertiesTransform='+ 'com.mysql.management.jmx.ConnectorMXJPropertiesTransform'; String user = 'root'; String password = ''; Class.forName(driver); Connection conn = DriverManager.getConnection(url, user, password);
You might create a separate users and database table spaces for each application, rather than using 'root and test'.
We highly suggest having a routine backup procedure for backing up the database files in the datadir.