File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Can't find JDBC driver for project in MyEclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Can Watch "Can New topic
Author

Can't find JDBC driver for project in MyEclipse

Steve Sherwood
Greenhorn

Joined: Jun 01, 2008
Posts: 10
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

Joined: Aug 06, 2008
Posts: 83

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....


Web Development Tips and Tutorials - By Sachin
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can't find JDBC driver for project in MyEclipse