tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peter.braw...@artfulsoftware.com
Subject Re: Help with Tomcat and mm.mql driver
Date Thu, 16 May 2002 14:27:23 GMT
David,

> Hello all,
>
> Hopefully this is an easy one...
> I am trying to connect to mysql from a servlet running on Tomcat 4.0.3.
> I have the mm.mysql driver installed and it works fine from within a Java
> console app.
>
> When I run the servlet I get the following error:
> "java.sql.SQLException: No suitable driver"
>
> I am running this servlet from Tomcat\webapps\ROOT\WEB-INF\classes\code_lib
> (code_lib being the name of the package I am creating...)
> I read in a few places that I should put the mm.mysql class in WEB-INF\lib,
> does this still apply if my app is not running in the "classes" directory?
> Or should it go in WEB-INF\code_lib\lib?
> Do I have to alter server.xml or modify the CLASSPATH?
>
> Hopefully this is enought information. Help is MUCH appreciated.

Two bits to this answer:

1. Tomcat itself ignores CLASSPATH. Put the MM.MySQL .jar file
in $CATALINA_HOME/common/lib.

2. If MM.MySQL is installed in c:mm_mysql, then _that_ path
needs to be in your CLASSPATH, the fully qualified path to the
Driver.class file is c:/mm_mysql/org/gjt/mm/mysql/Driver.class,
so the argument to Class.forName() in your servlet is
"org.gjt.mm.mysql.Driver"

HTH



--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message