[jboss-user] [Datasource Configuration] - Connect to MySQL without Datasource in JBoss AS 7.1

Pradeep Kumar do-not-reply at jboss.com
Thu Jul 18 08:00:16 EDT 2013

Pradeep Kumar [https://community.jboss.org/people/pradeepsixer] created the discussion

"Connect to MySQL without Datasource in JBoss AS 7.1"

To view the discussion, visit: https://community.jboss.org/message/828589#828589


I am using JBoss AS 7.1 and am trying to connect to MySQL database without creating a datasource name. Unfortunately, while running the client program,  the Bean throws ClassNotFoundException

Here is what I did :
I have put the mysql-connector-java-5.1.18-bin.jar in +JBOSS_HOME+/modules/com/mysql/jdbc/main . And created a module.xml file with the following contents :

<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.0" name="com.mysql.jdbc">
    <resource-root path="mysql-connector-java-5.1.18-bin.jar"/>
    <module name="javax.api"/>

Then updated the standalone.xml file with the following line under the drivers node

<driver name="mysql" module="com.mysql"/>

Here is my Bean Code :

Reply to this message by going to Community

Start a new discussion in Datasource Configuration at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20130718/47f45f92/attachment.html 

More information about the jboss-user mailing list