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:

  1. Download Connector/MXJ and copy the mysql-connector-mxj-gpl-[ver].jar file to the $JBOSS_HOME/server/default/lib directory.

    If you are using Connector/MXJ v5.0.4 or later, also copy the mysql-connector-mxj-gpl-[ver]-db-files.jar file to $JBOSS_HOME/server/default/lib.

  2. Download Connector/J and copy the mysql-connector-java-5.1.5-bin.jar file to the $JBOSS_HOME/server/default/lib directory.
  3. Create an MBean service xml file in the $JBOSS_HOME/server/default/deploy directory with any attributes set, for instance the datadir and autostart.
  4. 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.

Retornar