File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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:
subject: SQLNestedException: Cannot create JDBC driver of class ''
It's not a secret anymore!