[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

--------------------------------------------------------------
Hi,

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">
  <resources>
    <resource-root path="mysql-connector-java-5.1.18-bin.jar"/>
  </resources>
  <dependencies>
    <module name="javax.api"/>
  </dependencies>
</module>


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
[https://community.jboss.org/message/828589#828589]

Start a new discussion in Datasource Configuration at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2077]

-------------- 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