• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 151
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
still showing the same error.
Thanks and Regards
Harshal
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic