Hi,

I didn't know about this. I always thought java.sql.Connection.isClosed() told you
whether the connection to the database still exists or not. If what you all mention
is indeed the case, then in my opinion the most inexpensive SQL statement would be to
use "select sysdate from dual" to check whether the connection is still alive.

Sanjesh

Geeta Ramani wrote:

> Rob, we had the same problem and while waiting for a more brilliant idea(!!),
> wrote a function which returned true or false depending on whether the connection
> could execute a simple query like "select user_name from user_tables". Throw the
> execution of the query within a try/catch block, and ..well, I'm sure you can
> fill in the rest.
>
> Good luck and if you come up with a better solution please do let me know!
> Geeya
>
> Rob Hazlewood wrote:
>
> > java.sql.Connection.isClosed()
> > doesn't achieve the purpose that i want it for.
> > isClosed() only checks to see if the client has closed the connection, not if
> > the connection with the server has been lost. What is the best alternative??
> > (so if the connection is lost, a function will return true)
> >
> > thanks
> > Rob
> >
> > ____________________________________________________________________
> > Get free email and a permanent address at http://www.netaddress.com/?N=1
> >
> > ___________________________________________________________________________
> > 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