• 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

problem in loading Driver

 
Ranch Hand
Posts: 74
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I am trying to write simple servlet having jdbc code that connect to mysql database and retrieve a details of table fields , and i am using netbeans and wamp server to do my job.
let me explain what problem i am facing.....
Apache tomcat is complaining regarding Driver that....
java.lang.ClassNotFoundException: com.jdbc.mysql.Driver

and what i have tried to solve this..
1-i attached mysql-connector-java-5.1.6.jar to my project library
but i found the same problem ,when i observed wamp server's containing mysql folder that is- wamp/bin/mysql 5.1.36
and also i have been tried by adding mysql-connector-java-5.1.25 but still facing same above issue...
my simple servlet code is bellow...


i am not getting any clue that what i am missing or any extra stuff to do with my code please help me .
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Vivek Bhardwaj wrote:1-i attached mysql-connector-java-5.1.6.jar to my project library


But did you add it to Tomcat's lib folder?
 
viki Bhardwaj
Ranch Hand
Posts: 74
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rob Spoor wrote:

Vivek Bhardwaj wrote:1-i attached mysql-connector-java-5.1.6.jar to my project library


But did you add it to Tomcat's lib folder?



first i would say thanks Rob for your hint ,i tried to add as like you suggested but i am unable to find the location . actually i am using netbeans IDE and managing mysql and apache tomcat through wamp server ,so as you suggested i tried to do like this-
1-i looked for the place(tomcat's lib) in my project in netbeans but there is only project's library folder exists.
2-also i tried to search that directory in the wamp server folder like wamp/bin/apache/apache2.2.11 folder but there is no lib folder
3-and also tried by adding jar file in installed apache home directory lib folder(installed on C:\Program Files\Apache Software Foundation\Apache Tomcat 7.0.22\lib)

but still i am getting the same error....please help me out.
your reply would be highly appreciable.
 
viki Bhardwaj
Ranch Hand
Posts: 74
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please help me, still i am waiting for your valuable reply that would be helpful to resolve my problem , really i am curious to learn that how to work with wamp server to develop web application ,but i am stuck in a very common problem which i have posted above already.....please help me. i would be very thankful to your help.
 
viki Bhardwaj
Ranch Hand
Posts: 74
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Class.forName("com.jdbc.mysql.Driver");



I corrected, actually i had taken wrong qualified diver name as above ,now code is running fine...
thanks .
 
Then YOU must do the pig's work! Read this tiny ad. READ IT!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic