File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can't find JDBC driver for project in MyEclipse

 
Steve Sherwood
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm working on a Mac Pro, 2 Quad Core Processors, 10GB memory, 300GB Disk, OSX 10.5.4

When I try to get a connection to a local MySQL database in a web app, I get the error "No suitable driver."

1. I put the mysql-connector-java-5.1.6-bin.jar in my /lib/ext/ directory
2. I have configured the Java Build Path for the project and added external jar mysql-connector-java-5.1.6-bin.jar.
3. I tried putting the mysql-connector-java-5.1.6-bin.jar in the /Library/Java/Extensions folder.
4. I put the mysql-connector-java-5.1.6-bin.jar in the Tomcat/lib/ folder
5. I've tried adding the jar to the "Paths" setting in MyEclipse under Tomcat Server.

It seems like I've put the var everywhere I can possibly think of, but it still can't seem to find it.

Any ideas?
 
Sachin Joshi
Ranch Hand
Posts: 83
Java Spring Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How are you loading the driver? is it through a datasource code or you are using Clas.forName()?

Have you tried putting the mysql-connector-java-5.1.6-bin.jar file in <webappdir>/WEB-INF/lib

ideally it should be picked up by tomcat from this location.

Also just check following
1. if the jar is not corrupted.
2. If there are many jars in your web app then try to make sure driver jar comes first in the classpath....
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic