Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
    Bookmark Topic Watch Topic
  • New Topic

Mysql driver suddenly won't load in eclipse

 
Mike Southgate
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
 
PNS Subramanian
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
author & internet detective
Marshal
Posts: 34095
337
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Report post to moderator
Mike,
Please don't cross-post the same question in multiple forums. Please continue discussion in the IDEs thread
 
    Bookmark Topic Watch Topic
  • New Topic