Hei,
if this doesn't work.
Put the .jar file in your TOMCAT/webapps/YOUR_APPL/WEB-INF/lib.
When you put your .jar file in here, it's only accessible for this
WEB-Application.
When you put it in TOMCAT/lib it's accessible to all your Servlets/JSP.
You could also put it into your JDK/jre/lib/ext directory, so it's available
to all your Java Applicaitons.
I have read something about putting the .jar file in /JDK.... could cause
some errors.
Greetings,
Michael
Brahmanand Gannur wrote:
> put the mysql driver( .jar ) into the lib directory of the TOMCAT and
> restart the tomcat
> hope this helps
>
> -----Original Message-----
> From: Angela Stempfel [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, May 05, 2001 6:06 PM
> To: [EMAIL PROTECTED]
> Subject: Tomcat-MySQL connection problem
>
> Hi all,
>
> The past hours I tried to set up Tomcat on my local Win2000 box. I've
> installed the lastest MySQL package and also the latest Tomcat version I
> got.
>
> After I've read the manual of the JDBC Driver I was able to set it up
> that I can connect to MySQL with my short Java Class I wrote. This class
> simply creates some tables in MySQL, so far so good.
> Afterwards I tried to use exactly the same way of connecting to MySQL in
> my JSP Files, again using Java to connect to MySQL. But it doesn't
> matter how I try to do it, I always get the
> "javax.servlet.ServletException: No suitable driver..." Exception.
>
> I connect like this:
>
> try
> {
> Class.forName("org.gjt.mm.mysql.Driver").newInstance();
> }
>
> catch(Exception e)
> {
> System.err.println("Unable to load driver.");
> e.printStackTrace();
> }
>
> con =
> DriverManager.getConnection("jdbc:mysql://localhost/horse");
>
> As I said this *works* if I do that with a simple Java test-Class, but
> not after I try to do it in Tomcat. Classpath should be correct, at
> least I double checked it about 100 times. The Java files I use are in a
> package, could that be a problem? The test files are not in the package
> (to be honest, I don't really understand this package stuff :-)
>
> I've also tried to add the port (3306 which seems to be default port in
> MySQL) after localhost but this doesn't help. Is there a way to check if
> the port is really used in Windows?
>
> I'm really running out of ideas now, I checked all the information I
> found, checked the web on other mailinglists (google rulez) and every
> thing I tried did not help so far. So any suggestions are very welcome
> :-)
>
> thanks in advance
>
> Angela