This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Resource Jar's Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Resource Jar Watch "Resource Jar New topic
Author

Resource Jar's

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

I am trying to access a database using a servlet. My database is MySQL. I am using the gjt.mm..... Driver from the JAR resource file. It is telling me no suitable driver and I am wondering if I have my JAR file in the right place for TomCat? I have it in the classes directory where my servlet class file exists. I have also put it in my jdk/lib folder and in my classpath.
If this sounds more like a servlet problem, please move the post.
Thanks


GenRocket - Experts at Building Test Data
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Ok, I got it to work. Here is what I have done with my JAR file that contains my MySQL Driver.
JAR locations
tomcat\lib
j2sdk1.4.0\lib
classpath=j2sdk1.4.0\lib\mm.jar
Do I need that file in all those locations or just one or just 2??
This is not for compiling the source code. This is strickly so that the servlet can find the resource it needs.
Thanks
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

http://www.coderanch.com/t/81823/Tomcat/jdbc-oracle-hell

in Tomcat's common/lib directory

And when you compile, you can either use -classpath to include this directory, or put it in the system CLASSPATH (but in another post I make short work of that option).
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Resource Jar's
 
Similar Threads
Executing my .java in package
Jar file for DB2 Connection?
where to put my jdbc driver to mysql?
ClassNotFoundException while executing using "java -jar" command
tomcat and driver problem