aspose file tools*
The moose likes JDBC and the fly likes ClassNotFoundException with mysql Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "ClassNotFoundException with mysql" Watch "ClassNotFoundException with mysql" New topic
Author

ClassNotFoundException with mysql

mike nu
Ranch Hand

Joined: Mar 11, 2001
Posts: 63
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.
Amol Desai
Ranch Hand

Joined: Jan 29, 2003
Posts: 82
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.
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
...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


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Rosie Vogel
Ranch Hand

Joined: Jan 31, 2001
Posts: 228
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.
Victor Pendleton
Greenhorn

Joined: Jul 09, 2003
Posts: 4
Rosie, try putting the file in the web-inf/classes directory of your application.
Mathews P Srampikal
Ranch Hand

Joined: Nov 26, 2002
Posts: 211
hi all,

where i can download download My Sql driver?

Thanks,
Mats.


Thanks,
Mathews
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36478
    
  16
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ClassNotFoundException with mysql
 
Similar Threads
MySQL learning resources
Using MySQL for CMP Bean in RI
mysql Connector/J prerequisites
How to query a certain number of data?
Problem with com.mysql.jdbc.Driver driver