Re: JDBC Connection returns wrong status
- From: "joeNOSPAM@xxxxxxx" <joe.weinstein@xxxxxxxxx>
- Date: 15 Dec 2006 08:15:25 -0800
Connection.isClosed(0 is a pretty useless method. By spec, all it means
is whether *you* closed the connection. There is no way to know a
connection
is still good except to try and use it. Even if there was an
isThisConnectionGood()
method, the DBMS could go down right after you called it, so you have
to code
in a way that handles filed connections at any time, as best you
can....
GetMetaData() just returns you an object. You'd have to make an actual
metadata call, and one that requires talking to the DBMS, to see if the
connection
was good. ANd even if you do something like getting the database
version,
the driver may have already cached that from when it first logged in.
Do a "select 1" if you want to test...
Joe Weinstein at BEA Systems
.
- Follow-Ups:
- Re: JDBC Connection returns wrong status
- From: Robert Klemme
- Re: JDBC Connection returns wrong status
- References:
- JDBC Connection returns wrong status
- From: evgchech
- JDBC Connection returns wrong status
- Prev by Date: JDBC Connection returns wrong status
- Next by Date: Re: Problem with jdbc, RowSet and Oracle
- Previous by thread: JDBC Connection returns wrong status
- Next by thread: Re: JDBC Connection returns wrong status
- Index(es):
Relevant Pages
|