• 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

ClassNotFoundException

 
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic