Book Image

JDBC 4.0 and Oracle JDeveloper for J2EE Development

Book Image

JDBC 4.0 and Oracle JDeveloper for J2EE Development

Overview of this book

Table of Contents (20 chapters)
JDBC 4.0 and Oracle JDeveloper for J2EE Development
Credits
About the Author
About the Reviewer
Preface

Configuring JBoss Server with MySQL Database


MySQL is an open-source database used by many open-source projects and small organizations. To use JBoss 4.0 with MySQL, we have to put the MySQL driver classes into the runtime classpath of JBoss application server and copy the MySQL Connector/J 5.1 driver JAR file to the C:\JBoss\jboss-4.0.5.GA\server\default\lib directory. MySQL Connector/J 5.1 driver supports JDBC 4.0 and can be obtained from http://dev.mysql.com/downloads/connector/j/5.1.html. We also need to set the JAVA_HOME environment variable to JDK 6.0.

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<driver-class/> to com.mysql.jdbc.Driver and<connection-url/> to jdbc:mysql://localhost:3306/test.

Finally, modify server/default/conf/login-config.xml with MySQL database settings and add the following<application-policy/> element to \server\default\conf\login...