I am using JdbcOdbc bridge to connect a database. The connection is working
fine with Javawebserver2.0;
But the same servlet is giving error with Appachy-Jserver! I am getting
internal error.
Do I need to change any properties in Appachy?
I would appreciate your help
----- Original Message -----
From: Bradley McLain <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, April 09, 2000 5:43 PM
Subject: Re: Db connection crashes servlet server
> you must close your resultset when you are finished with it. add a line
> right before you return that reads: result.close();
>
> bradley mclain
>
> >From: Barranger Ridler <[EMAIL PROTECTED]>
> >Reply-To: "A mailing list for discussion about Sun Microsystem's Java
> > Servlet API Technology." <[EMAIL PROTECTED]>
> >To: [EMAIL PROTECTED]
> >Subject: Db connection crashes servlet server
> >Date: Sat, 8 Apr 2000 16:09:07 -0400
> >
> >Hello there,
> >
> > I have a simple servlet that connects to an access database to
> >check the
> >name and password of a user. While it does check this correctly, the
> >server
> >will crash a few minutes later (Possibly when the distroy() method is
> >called?? which has no code). Anyways any help would definately help.
> >Here's the code that is used to connect. Sorry about the length
> >
> >Barranger
> >
> > /**
> > * Check the User Name and Password
> > */
> > public boolean login(String name, String pwd)
> > {
> > file://Set the Variables to connect to the Database
> > String URL = "jdbc:odbc:Mail";
> > String username = "";
> > String password = "";
> >
> > file://Try to load the appropriate Driver
> > try
> > {
> > Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
> > }
> > catch (Exception e)
> > {
> > return false;
> > }
> >
> > file://Declare the Objects
> > Statement stmt = null;
> > Connection con = null;
> >
> > file://Create the Objects
> > try
> > {
> > con = DriverManager.getConnection (URL, username, password);
> > stmt = con.createStatement();
> > }
> > catch (Exception e)
> > {
> > return false;
> > }
> >
> > file://Declare and Create the ResultSet object
> > try
> > {
> > ResultSet result = stmt.executeQuery
> > (
> > "SELECT * FROM user WHERE
> >user_name = '" + name +
> > "' AND user_password = '" + pwd
+
> >"';"
> > );
> >
> > file://If there are any records then the user
exists
> > if(result.next())
> > {
> > return true;
> > }
> > else
> > {
> > return false;
> > }
> > }
> > catch (Exception e)
> > {
> > return false;
> > }
> > }
> >
>
>___________________________________________________________________________
> >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
>
> ______________________________________________________
> Get Your Private, Free Email at http://www.hotmail.com
>
>
___________________________________________________________________________
> 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