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&...]