This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes mysql driver classpath How to plz? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "mysql driver classpath How to plz?" Watch "mysql driver classpath How to plz?" New topic

mysql driver classpath How to plz?

Gul Khan
Ranch Hand

Joined: Sep 03, 2003
Posts: 173
I am getting a ClassNotFoundException when i try to connect to database from my java class. It works fine with servlets and jsp.
I have installed the driver in my G:Tomcat/common/lib and the classpath is also set
The error it gives is
What should i do to avoid this problem
[ September 21, 2003: Message edited by: pervaiz gul ]
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

Try this on the command line:

Firstly, is there a typo in your classpath? should it be g:/tomcat instead of g:tomcat. Also, you can open the jar in Winzip or similar program to make sure the Driver exists in the same place. I'm not sure this is the right Driver for this jar file, but then it's been a while since I used MySQL.
Gul Khan
Ranch Hand

Joined: Sep 03, 2003
Posts: 173
Thanks David. there was a typo in the classpath.
but just wondering y was i getting the connection in tomcat at some places. :roll:
Marilyn de Queiroz

Joined: Jul 22, 2000
Posts: 9059
Servlets and JSPs don't use the mySQL driver if the servlets and JSPs don't use JDBC.

"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
I agree. Here's the link:
subject: mysql driver classpath How to plz?
It's not a secret anymore!