tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From # Lalit Nagpal # <>
Subject Re: what is needed to connect to mysql
Date Fri, 03 May 2002 05:04:06 GMT

 thanx christian,
prob was when i put a jar in the classpath it would not locate the classes. now when i have
extracted the contents of mm driver and kept the extracted contents in the classpath .. everything
works just fine.
Thanx anyway ...
  Christian Bockerman <> wrote: 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"

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

Driver DriverRecordSet1 = (Driver)Class.forName("").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
You can read about that in

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...


To unsubscribe: 
For additional commands: 
Troubles with the list: 

# Lalit Nagpal #

Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message