I use IBM DB2 and have found that you really need to make something flow on
the connection to test it.
The following is a snippit from my "getDbConnection()" code:

java.sql.Statement s = dataConn.createStatement();
// This flows to DB2 and effectively does nothing.
s.execute("SET CURRENT SQLID = '" + this.spec.getLoginUser() + "'");

John Zerbe - Mellon Bank
Phone:  412-234-1048   E-Mail: [EMAIL PROTECTED]



> -----Original Message-----
> From: Chris Pratt [SMTP:[EMAIL PROTECTED]]
> Sent: Monday, June 14, 1999 9:20 PM
> To:   [EMAIL PROTECTED]
> Subject:      Re: 'Connection.isClosed()' doesn't work....
>
> Try createStatement, in my experience, if it works, you have a good
> connection.
>     (*Chris*)
>
> ----- Original Message -----
> From: jang eui jin <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, June 14, 1999 5:14 PM
> Subject: 'Connection.isClosed()' doesn't work....
>
>
> > Hello All !
> >
> > Sorry. It is off topic. but I long for your help.
> >
> > I need to check whether connection to db has problem or not in a
> > ConnectionPoolServlet.
> >
> > But, even though a real db connection is disconnected, 'con.isClosed()'
> > return true.
> >
> > I don't know why.
> > How can I successfully check db connection ?
> >
> >
> __________________________________________________________________________
> _
> > 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

___________________________________________________________________________
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

Reply via email to