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 jdbc mysql --- ClassNotFoundException problem ... please help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "jdbc mysql --- ClassNotFoundException problem ... please help" Watch "jdbc mysql --- ClassNotFoundException problem ... please help" New topic
Author

jdbc mysql --- ClassNotFoundException problem ... please help

Bill Mares
Greenhorn

Joined: Dec 31, 2003
Posts: 4
Hi,
I am porting an application over from using an oracle db to a mysql db. I was doing the oracle dev on a unix box, but now I am on Windows 2000. I am having a configuration problem. I have looked through the online suggestions, but found no solution.
Some code:

This is the important code where it is having problems. Basically, the things I have seen tell me that I have to place the driver [ currently using mysql-connector-java-3.0.9-stable-bin.jar from mysql.com ] where it can be seen. I have it stored in a directory under the C: drive and have added the jar file to the classpath, ie. added C:\somedir\mysql-connector-java-3.0.9-stable-bin.jar to the PATH variable in the environment variables. Can anyone suggest how to fix this?
I also tried adding the jar file to the C:\JAVA_HOME\jre\lib\ext but no luck there either. Please help.
Bill Mares
Greenhorn

Joined: Dec 31, 2003
Posts: 4
ok, figured it out.
I had 2 installed jdk directories and had placed the jar file in the wrong one. Sorry about the question.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
FYI, you add stuff into the classpath by using the CLASSPATH environment variable, not PATH.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: jdbc mysql --- ClassNotFoundException problem ... please help
 
Similar Threads
Error while starting jboss(java.lang.ClassNotFoundException: No ClassLoaders found for: com.mysql.j)
DataSource Not Found Struts with WSAD 5 & MySQL
Help needed with JDBC driver
Classpath to mysql-driver
ClassNotFoundException Error Giving Me Grief