• 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 with mysql

 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can anyone help me figure out what cause this problem:
I am trying to use mysql database and use JDBC to connect to it. But I always get the ClassNotFoundException with the following statement: Class.forName("org.gjt.mm.mysql.Driver").newInstance();
Anyone know the reason? BTW, I am testing this connection in JBuilder 6.0 environment.
Thanks a lot.
 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
you need to put the jar file(mysql.jat) of your
driver classes in the classpath of jbuilder 6
You can the jar file in <jbuider-home>/lib/ext directory and restart it.
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
...and if you're running a Servlet, then the Servlet container will need the MySQL driver JAR as well.
Note that you're using an old driver. You might want to update your code and available classes to make use of com.mysql.jdbc.Driver, available in the newest J/Connector download at mysql.com
 
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Dirk Schreckmann:
...and if you're running a Servlet, then the Servlet container will need the MySQL driver JAR as well.


I am having the same problem... I have put the a copy of the MySQL driver JAR in the Tomcat lib directory but that didn't work. Is this what you meant? I also have the jar in my classpath.
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Rosie, try putting the file in the web-inf/classes directory of your application.
 
Ranch Hand
Posts: 211
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all,

where i can download download My Sql driver?

Thanks,
Mats.
 
Marshal
Posts: 79153
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Mathews P Srampikal:
hi all,

where i can download download My Sql driver?

Thanks,
Mats.

Please don't come in on somebody else's thread with an unrelated question; that is called hijacking and can divert attention from the original topic.

You should have gone to Google and you would have found this and this.
 
So I left, I came home, and I ate some pie. And then I read this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic