File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC 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 Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "mysql driver classpath How to plz?" Watch "mysql driver classpath How to plz?" New topic
Author

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
G:Tomcat\common\lib\mysql-connector-java-3.0.8-stable-bin.jar;.
The error it gives is
ClassNotFoundException: org.gjt.mm.mysql.Driver
What should i do to avoid this problem
[ September 21, 2003: Message edited by: pervaiz gul ]
David O'Meara
Rancher

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
Sheriff

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


JavaBeginnersFaq
"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: http://aspose.com/file-tools
 
subject: mysql driver classpath How to plz?