• 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

Could not find com.mysql.jdbc.Driver

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i am usin fedora 14 (i386)..
problem while connecting jdbc with mysql...help me out...here it is--


[Amit@root Downloads]$ java MysqlConnect
MySQL Connect Example.
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:186)
at MysqlConnect.main(MysqlConnect.java:13)
[Amit@root Downloads]$ javap com.mysql.jdbc.Driver
ERROR:Could not find com.mysql.jdbc.Driver


help me out...i have set classpath..
tell me how to set it n how to check classpath..so that i can check mine..please help me out..please...
 
Ranch Hand
Posts: 47
MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Try this-

Put Driver mysql-connector (jar) in classpath
And also in WEB-INF/lib/ folder.




Thank you
 
Amit Lohar
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
please explain in brief..please i need this to work..please..
 
Divya Chandel
Ranch Hand
Posts: 47
MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Amit,

Can you make a new folder name 'lib' inside WEBINF folder and copy the mysql driver inside that lib folder than try to run
hopefully it will work.
 
Ranch Hand
Posts: 530
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Copy the mysql-connector-java-5.1.21-bin.jar file under the same location of MysqlConnect.java file, compile and type the following command to run the program:



You can see more details here.
 
This cake looks terrible, but it tastes great! Now take a bite out of this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic