wood burning stoves 2.0*
The moose likes Tomcat and the fly likes SQLNestedException: Cannot create JDBC driver of class '' Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "SQLNestedException: Cannot create JDBC driver of class Watch "SQLNestedException: Cannot create JDBC driver of class New topic

SQLNestedException: Cannot create JDBC driver of class ''

Barry Gold

Joined: Dec 15, 2005
Posts: 22
I am setting up a test environment for JSPs on my desktop machine. I have got Tomcat running, but when I try to use the database I get an error.

Here is the code:
String conStr = "java:comp/env/jdbc/<dbname>";
con = DBConnection.getConnection(conStr);

It fails on getConnection. I have a copy of mysql running, I can reach it from the command line and from PHP pages.

Here is the top of the <Host> entry, including the <Resource> for the database:
<Host name="localhost" appBase="C:/barry"
unpackWARs="true" autoDeploy="true" debug="1"
xmlValidation="false" xmlNamespaceAware="false">
<Context docBase="suauto2006/public_html" path=""
swallowOutput="true" crossContext="true"
cookies="true" reloadable="false">
<Resource name="jdbc/suzuki_dealers" auth="Container"
maxActive="100" maxIdle="30" maxWait="10000"
username="integrat" password="test99a"

Here is the reference in my application's web.xml:

Resource reference to a factory for java.sql.Connection
instances that may be used for talking to a particular
database that is configured in the server.xml file.

Here is the traceback:

rg.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'jdbc:mysql://localhost:3306'
[ July 07, 2006: Message edited by: Bear Bibeault ]
Chad Clites
Ranch Hand

Joined: Aug 16, 2005
Posts: 134
Is it possible that you don't have the JDBC driver in the correct location? I am pretty noobish at this myself, but I seem to remember a very similar error when I had the JDBC driver .jar in the wrong location.
Barry Gold

Joined: Dec 15, 2005
Posts: 22
The JDBC driver is installed. Other pages that use JDBC work. It's a configuration issue of some sort.
I agree. Here's the link: http://aspose.com/file-tools
subject: SQLNestedException: Cannot create JDBC driver of class ''
Similar Threads
Cannot create JDBC driver
configure SQL Server 2000 DataSource in Tomcat 5.0.28
resouce config problem
Problem in connection pooling
tomcat. dbcp.dbcp.BasicDataSource error but using javax.sql.DataSource