tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacob Kjome <h...@visi.com>
Subject Re: R: what is needed to connect to mysql
Date Thu, 02 May 2002 20:54:01 GMT
Hello Gianluca,

Or use:

Thread.currentThread().getContextClassLoader().loadClass(dbDriver);

Instead of:

Class.forName(dbDriver);

The latter won't find the driver if it isn't immediately within the
same classloader as the class calling Class.forName where the first
one will find it in parent classloaders, so you can have the driver in
$TOMCAT_HOME/lib or $TOMCAT_HOME/common/lib...or WEB-INF/lib if you
still want to do that.

Jake

Thursday, May 02, 2002, 4:31:15 AM, you wrote:



>> -----Messaggio originale-----
>> Da: # Lalit Nagpal # [mailto:lalit_tomcat@yahoo.com] 
>> Inviato: giovedì 2 maggio 2002 11.09
>> A: tomcat-user@jakarta.apache.org
>> Oggetto: what is needed to connect to mysql
>> 
>> 
>> 
>> 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"
>> 
>> plz help ... 
>> 

GG> Put your jdbc driver for mysql in your {webapp}/WEB-INF/lib/folder ...
GG> It should work!

GG> Bye, Grava



GG> --
GG> To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
GG> For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
GG> Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>



-- 
Best regards,
 Jacob                            mailto:hoju@visi.com


--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message