1

I am working on a project where we need to access tables from mysql database. But, I keep getting the following exception in eclipse.

java.lang.classnotfoundexception com.mysql.jdbc.driver

I have downloaded the mysql-connector-java-5.1.23 and tried placing the jar file at lib file of the project and since it didnt work I placed it in Apache's lib..But again got the same problem..I have also tried setting the environment class path variable to point to the jar file..but it still didn't work..

I am using eclipse juno and MySQL Server 5.0 with apache tomcat 7.0

please help!

spajce
  • 7,044
  • 5
  • 29
  • 44
user2119453
  • 41
  • 1
  • 4

3 Answers3

1

try this

right click on the project

-->buildpath
 -->configure build path
-->add external jar files
and then select your jar file

you need to add to the build path of the project.

PSR
  • 39,804
  • 41
  • 111
  • 151
0

If you are creating JPA project then you have to add the .jar files.

Right click on project->buildpath->configure build path. In that click the "Libraries" on the top. Now click the Add External Jars and browse the jar u downloaded and add.

Hope it will work.

Sathesh S
  • 1,253
  • 3
  • 23
  • 54
0

Right click on your project select Propertys then select Java Build Path and add your file as external JAR

user982115
  • 23
  • 3