For deployment 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
connector-mxj.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
connector-mxj-db-files.jar
file to
$JBOSS_HOME/server/default/lib
.
Download Connector/J and copy the
mysql-connector-java-
file to the
5.0.4
-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
.
Ésta es una traducción del manual de referencia de MySQL, que puede encontrarse en dev.mysql.com. El manual de referencia original de MySQL está escrito en inglés, y esta traducción no necesariamente está tan actualizada como la versión original. Para cualquier sugerencia sobre la traducción y para señalar errores de cualquier tipo, no dude en dirigirse a mysql-es@vespito.com.