This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes JDBC and the fly likes Cannot create JDBC driver of class '' for connect URL 'null' Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "Cannot create JDBC driver of class Watch "Cannot create JDBC driver of class New topic
Author

Cannot create JDBC driver of class '' for connect URL 'null'

Abhin Thomas
Greenhorn

Joined: Aug 07, 2007
Posts: 5
Hi all,
I am working on a web based project using struts 2 and spring. The backend is mySql. I am not able to setup the application to work with mySql.

In server.xml I have set,
<Context docBase="MyProj" path="/MyProj" reloadable="true" source="org.eclipse.jst.jee.server:MyProj">

<Resource name="jdbc/mySqlDB" auth="Container" type="javax.sql.DataSource" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/dbox?autoReconnect=true"
username="abin" password="abin" maxIdle="10" maxWait="1000" />
</Context>
In web.xml I have
<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/mySqlDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>

I am using Spring, so in applicationContext I have set:
<jee:jndi-lookup id="dataSource"
jndi-name="java:comp/env/jdbc/mySqlDB" />
When I try to use the SpringDAO for inserting some data, it gives me the following exception:

org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'

Can anybody tell me what I am doing wrong here.

Thanks and regards,
Abin
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Cannot create JDBC driver of class '' for connect URL 'null'
 
Similar Threads
Juddi DB connection problem
Cannot load JDBC driver class 'com.mysql.jdbc.Driver'
Problem with connection pooling
SQLNestedException: Cannot create JDBC driver of class'' for connect URL
struts 1.3 Data base connection pool