MySQL is an open source database used by many open source projects and small organizations. To use JBoss 4.0 with MySQL, we first need to put the MySQL driver classes into the CLASSPATH. Copy the .jar file mysql-connector-java-3.0.9-stable-bin.jar to the /server/default/lib directory.

To use the MySQL data source, copy /docs/examples/jca/mysql-ds.xml to the /server/default/deploy directory. Modify the mysql-ds.xml configuration file by setting to com.mysql.jdbc.Driver and to jdbc:mysql:///, where is the MySQL host server and is the MySQL database.

Next, we need to set the and elements in the standardjaws.xml or jaws.xml file:
[xml]

java:/MySqlDS
mySQL

[/xml]

We also need to set the and elements in the standardjbosscmp-jdbc.xml or jbosscmp-jdbc.xml file:
[xml]


java:/MySqlDS
mySQL


[/xml]

Finally, we modify login-config.xml with MySQL database settings. Add the following element to login-config.xml:
[xml]


"org.jboss.resource.security.ConfiguredIdentityLoginModule"
flag = "required">
sa
sa


jboss.jca:service=LocalTxCM,name=MySqlDS




[/xml]

By modifying the mysql-ds.xml, standardjaws.xml, standardjbosscmp-jdbc.xml, and login-config.xml files, the JBoss 4.0 server is configured to be used with a MySQL database.

Source

Trackback

no comment untill now

Sorry, comments closed.