aspose file tools*
The moose likes JDBC and the fly likes ClassNotFoundException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "ClassNotFoundException" Watch "ClassNotFoundException" New topic
Author

ClassNotFoundException

preethi Ayyappan
Ranch Hand

Joined: Oct 04, 2007
Posts: 518
Hi

I have formatted my windows machine and i have installed jdk ,my sql ,eclipse.when i tried to run my program with jdbc connection in eclipse,I found the error:

java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

my database connection string is:

I have added the mysqlconnector.jar in the project in eclipse,and i have mentioned the classpath in environmentvariables as "D:\Program Files\java\jdk1.6.0_03\lib\mysql-connector-java-3.0.17-ga-bin.jar"

where am i wrong ?please guide me to solve this

Thanks
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
preethi Ayyappan wrote:
I have added the mysqlconnector.jar in the project in eclipse

You need to add it to the project's buildpath (Eclipse's term for the classpath which is to be used during both compile and runtime). Rightclick project, go to Buildpath and add the JAR file to it.


,and i have mentioned the classpath in environmentvariables as "D:\Program Files\java\jdk1.6.0_03\lib\mysql-connector-java-3.0.17-ga-bin.jar"

The classpath environment variable is totally ignored by Eclipse. It is normally only used by the java.exe when you run it without the -cp or -classpath argument.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ClassNotFoundException