tomcat-users mailing list archives

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

> 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


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message