hi; leave the jar exactly whrere you did (common/lib). the DB driver jar & java mail jars(if you use them) should be in the commin/lib. other jars should be in web-inf/lib.
-----Original Message----- From: A mailing list for discussion about Sun Microsystem's Java Servlet API Technology. [mailto:[EMAIL PROTECTED] Behalf Of Thiharie Rajesh Sent: Wednesday, July 14, 2004 7:29 AM To: [EMAIL PROTECTED] Subject: Re: AW: why can't my servlet connect to mysql...? You should put all required JAR files in the WEB-INF/lib directory. The common\lib folder is meant for the server, not for applications. -----Original Message----- thanx a lot all..i've already solved the problem by just copying the file mysql-connector-java-3.0.14-production-bin.jar into tomcat\common\lib folder... btw why don't tomcat search in my classpath for the file? cause the file is already included in my classpath as below: -------------------------------------------------- C:\Documents and Settings\Administrator>echo %classpath% .;C:\jaf-1.0.2\activation.jar;C:\javamail-1.3.1\mail.jar;C:\javamail-1.3.1\l ib\i map.jar;C:\javamail-1.3.1\lib\mailapi.jar;C:\javamail-1.3.1\lib\smtp.jar;C:\ java mail-1.3.1\lib\inetfactory.jar;C:\mysql-connector-java-3.0.14-production\mys ql-c onnector-java-3.0.14-production\mysql-connector-java-3.0.14-production-bin.j ar;C :\Program Files\Apache Software Foundation\Tomcat 5.0\common\lib\servlet-api.jar ---------------------------------------------- --- "Meißner,_Heinz" <[EMAIL PROTECTED]> wrote: > i use, > in mysql/lib/.... > > > -----Ursprüngliche Nachricht----- > > Betreff: Re: why can't my servlet connect to > mysql...? > > when you say "in the classpath ;-)", where exactly > did you > > place it in the > > directory structure of tomcat? > > > > -----Original Message----- > > Subject: AW: why can't my servlet connect to > mysql...? > > in the classpath ;-) > > < > Class.forName("com.mysql.jdbc.Driver").newInstance(); > > > > u can see this driver in ure gui ? > > sorry im using eclipse ... > > > -----Ursprüngliche Nachricht----- > > > Betreff: Re: why can't my servlet connect to > mysql...? > > > where did you put your driver jar? > > > -----Original Message----- > > > Subject: why can't my servlet connect to > mysql...? > > > hi...it seems that my servlet have problem > connecting > > > to mysql... > > > here's a part of my servlet code: > > > --------------------------------------------- > > > public class RegisterUser extends HttpServlet{ > > > public void service(ServletRequest request, > > > ServletResponse response)throws > IOException{ > > > > > > response.setContentType("text/html"); > > > PrintWriter pw = response.getWriter(); > > > try{ > > > > > > > Class.forName("com.mysql.jdbc.Driver").newInstance(); > > > java.sql.Connection con; > > > con = DriverManager.getConnection > > > > ("jdbc:mysql://127.0.0.1/mysql?user=root&password=root1234"); > > > > > > > > > } > > > catch (Exception e){ > > > pw.println("\nError: " + e.getMessage()); > > > } > > > } > > > } > > > ----------------------------------------------- > > > i got the error message: Error: > com.mysql.jdbc.Driver > > > any idea what did i do wrong here..? cause my > another > > > java application can connect to mysql without > any > > > problem..using the same syntax as above.. > > > thanx a lot. any help are greatly appreciated. ___________________________________________________________________________ This email and any attached to it are confidential and intended only for the individual or entity to which it is addressed. If you are not the intended recipient, please let us know by telephoning or emailing the sender. You should also delete the email and any attachment from your systems and should not copy the email or any attachment or disclose their content to any other person or entity. The views expressed here are not necessarily those of Churchill Insurance Group plc or its affiliates or subsidiaries. Thank you. Churchill Insurance Group plc. Company Registration Number - 2280426. England. Registered Office: Churchill Court, Westmoreland Road, Bromley, Kent BR1 1DP. ___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html ___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html