aspose file tools*
The moose likes JDBC and the fly likes Mysql driver suddenly won't load in eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Reply locked New topic
Author

Mysql driver suddenly won't load in eclipse

Mike Southgate
Ranch Hand

Joined: Jul 18, 2003
Posts: 183
I'm not sure if this is the correct forum or not for this...

I'm reatively new to eclipse, but I had it working for a few weeks with mysql.
Suddenly, my code cannot load the database driver for mysql, ie

Class.forName("comm.mysql.jdbc.Driver").newInstance();

throws an exception.

I must have done something to eclipse to make this happen but I'm not sure what.

When I first set up mysql with eclipse I copied the mysql-connector-java-3.0.14-production-bin.jar file into the lib\ext directory of my SDK and it's still there.

Could someone give me some pointers on how to track down the problem.

I suspect it's related to my making eclipse remember my decision with respect to running even when compile errors are present. This was inadvertent - how can I reverse it?

Any suggestions would be appreciated.

ms


ms<br />SCJP, SCJD
PNS Subramanian
Ranch Hand

Joined: Jul 13, 2004
Posts: 150
For the first part of the question
Suspect that it is just an issue of adding the jar file to the classpath.
Try the following in eclipse
Right Click of project -> properties -> Java build path -> Libraries -> Add external jars -> Order and Export -> select All -> ok.


To stop running when there are compilation errors do the following
Window -> Preference -> Java -> Compiler - change the settings on the right tab as required.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30537
    
150

Mike,
Please don't cross-post the same question in multiple forums. Please continue discussion in the IDEs thread


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Mysql driver suddenly won't load in eclipse