• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Harshal Gurav
Ranch Hand
Posts: 151
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pobably an obvious question but which MySQL JDBC driver are you using and is it in one of the directories specified in the CLASSPATH?
 
Harshal Gurav
Ranch Hand
Posts: 151
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 151
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
still showing the same error.
Thanks and Regards
Harshal
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1179
Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic