hi i am using bea weblogic for servlets and jsp. i have successfully installed mysql and driver from web. I have installed the connectorJ driver and added it's jar to the classpath. Anyone, working with this bea weblogic server in particular? where to mention mySQL db connections and what? i don't know how to see the connections of database-driver are successful with weblogic. please help! thanks
-----Original Message----- From: A mailing list about Java Server Pages specification and reference [mailto:[EMAIL PROTECTED]]On Behalf Of Partha Ranjan Das Sent: Sunday, February 16, 2003 9:03 PM To: [EMAIL PROTECTED] Subject: Re: database connection problem Hi, Why are you returning Connection in the finally block? return it as usual outside the finally block. And also throw the Exception from catch block so that you are aware that exception has really occured. Then handle it accordingly in the client. regards, Partha -----Original Message----- From: Deepak [mailto:[EMAIL PROTECTED]] Sent: Monday, February 17, 2003 10:22 AM To: [EMAIL PROTECTED] Subject: database connection problem Hi I am facing a frustrating problem here. I am having a login screen. When users enter username and pwd they are validated against a database (mysql). Everything is working perfectly. but some times users get a null pointer exception when they are logging in. I suspect that the connection object being returned is null sometimes. but why is it occuring only some times ? other times eeverything is working fine. I am using a class to connect to the db. Please read the code for the class belwo ******************************************* import java.sql.*; public class DBConnector{ public Connection conn; public Connection connect() throws java.sql.SQLException{ try{ Class.forName("org.gjt.mm.mysql.Driver"); conn=DriverManager.getConnection("jdbc:mysql://192.168.0.4/WEBDB","test","te s t"); }catch(Exception e){ System.out.println(e.toString()); }finally{ return conn; } } } ***************************************** In my login validation jsp page I use this line of code to connect to the db DBConnector dbc=new DBConnector(); conn=dbc.connect(); SQL="select UserCode from t_users where Password=password(?)"; pstmt=conn.prepareStatement(SQL); approximatley 200 users access my web application. Can you please explain whats wrong in my approach? Its kinda critical to me. Any help wud be invaluable Thanx in advance Deepak =========================================================================== To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST". Some relevant archives, FAQs and Forums on JSPs can be found at: http://java.sun.com/products/jsp http://archives.java.sun.com/jsp-interest.html http://forums.java.sun.com http://www.jspinsider.com ********************************************************************* Disclaimer: The information in this e-mail and any attachments is confidential / privileged. It is intended solely for the addressee or addressees. If you are not the addressee indicated in this message, you may not copy or deliver this message to anyone. In such case, you should destroy this message and kindly notify the sender by reply email. Please advise immediately if you or your employer does not consent to Internet email for messages of this kind. ********************************************************************* =========================================================================== To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST". Some relevant archives, FAQs and Forums on JSPs can be found at: http://java.sun.com/products/jsp http://archives.java.sun.com/jsp-interest.html http://forums.java.sun.com http://www.jspinsider.com =========================================================================== To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST". Some relevant archives, FAQs and Forums on JSPs can be found at: http://java.sun.com/products/jsp http://archives.java.sun.com/jsp-interest.html http://forums.java.sun.com http://www.jspinsider.com