Hi !

On Thu, May 02, 2002 at 02:09:09AM -0700, # Lalit Nagpal # wrote:
> 
> hello,
> 
> plz can anybody tell me how to connect to a mysql database through
> a servlet. i know how to prepare a connection etc through code but
> what other settings are needed. i am using tomcat 4 as a standalone.
> 
> The error i get is "Class not found org.gjt.mm.mysql.Driver"
>

As the message says, the classloader cannot find the mysql-driver
class. I guess your having something like

  Driver DriverRecordSet1 = 
(Driver)Class.forName("org.gjt.mm.mysql.Driver").newInstance();

in your code. Now imagine that your classloader wants to load a class.
There are a few places where he can look for it. Either the places
specified in your CLASSPATH-Variable or the predefined places of your
tomcat-installation. 
You can read about that in 
   http://jakarta.apache.org/tomcat/tomcat-4.0-doc/class-loader-howto.html

where it says that you should put your mysql-2.0.4.jar (or how it is
called) in $CATALINA_HOME/lib. This would share your mysql-classes across
all webapplications.

Hope this helps...

-Christian

--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to