aspose file tools*
The moose likes JDBC and the fly likes Error:Cannot create JDBC driver of class '' for connect URL 'null'  Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Error:Cannot create JDBC driver of class Watch "Error:Cannot create JDBC driver of class New topic
Author

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

Harshal Gurav
Ranch Hand

Joined: May 29, 2008
Posts: 151
Hi,
I am trying to connect mysql database fron jsp page.Here is my code:

and here is an context.xml saved in catalina home/conf/context.xml.


my application resides at catalinahome/webapps/root/application direcory.

also my classpath variable is


I am getting error while connecting to database like
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'

java.sql.SQLException: No suitable driver


Can anyone help here?
Any suggestion is highly appreciated.
Thanks and regards
Harshal
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Pobably an obvious question but which MySQL JDBC driver are you using and is it in one of the directories specified in the CLASSPATH?


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
Harshal Gurav
Ranch Hand

Joined: May 29, 2008
Posts: 151
Hi Martin,
Thank you for your reply.
Can you more elaborate the same?
my updated classpath strucure like:


but showing the same Error?
Can you help here.
Thanks and Regards
Harshal
[ September 15, 2008: Message edited by: Harshal Gurav ]
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Originally posted by Harshal Gurav:
Hi Martin,
Thank you for your reply.
Can you more elaborate the same?
my updated classpath strucure like:


but showing the same Error?
Can you help here.
Thanks and Regards
Harshal

[ September 15, 2008: Message edited by: Harshal Gurav ]


I think you are missing the .jar at the end of your CLASSPATH, I think it should be:

Harshal Gurav
Ranch Hand

Joined: May 29, 2008
Posts: 151
Hi,
still showing the same error.
Thanks and Regards
Harshal
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42927
    
  68
The exception sounds more like the parameters for the JDBC driver class and the JDBC URL are not set correctly. Make sure the parameter names are correct.
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

Maybe this solution works Full Solution for Oracle 8i - 10g and Tomcat 5.5.4

It is for a Oracle database connection setup - but it should work with a MySQL database as well - just replace the Oracle specific with MySQLs.


Regards, Rene Larsen
Dropbox Invite
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error:Cannot create JDBC driver of class '' for connect URL 'null'