Help with Tomcat and mm.mql driver
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. Thanks, Dave -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Help with Tomcat and mm.mql driver
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:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Help with Tomcat and mm.mql driver
Hey guys, Thanks for your help, I managed to get it working! I had previously dropped the jar file in tomcat\lib but was still getting class not found errors. Just for kicks I rebooted and it started working (I had previously just tried restarting Tomcat). Go figure... Thanks again! -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]