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].jar
file
to the $JBOSS_HOME/server/default/lib
directory.
If you are using Connector/MXJ v5.0.4 or later you will also
need to copy the
mysql-connector-mxj-gpl-[ver]-db-files.jar
file to $JBOSS_HOME/server/default/lib
.
Download Connector/J and copy the
mysql-connector-java-
file to the
5.1.5
-bin.jar$JBOSS_HOME/server/default/lib
directory.
Create an MBean service xml file in the
$JBOSS_HOME/server/default/deploy
directory with any attributes set, for instance the
datadir
and
autostart
.
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 may wish to 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
.
User Comments
Add your own comment.