> Hi,
>
> I'm looking for a standard way to know when a connection has been
> timed out.
Hi. There is no standard way. Choose a query or call that you are sure has to go to the
DBMS, and is as fast and uncontentious as possible.
> Right now, I found the following solutions:
>
> - Make a query and check out the result. If it's an exception,
> reopen the connection.
That's the only way. Also note that the connection could go bad immediately after your
test query succeeded... The fundamental fact is that a client can never know if it's
next attempt to talk to the server will succeed.
> - Just check every exception for every query.
>
> Well, as you can see they are far from ideal solutions. I just
> can't check the isClosed() because it only returns true when the
> *client* closes the connection.
Correct. That is the JDBC spec.
> Do you know any way to know if the connection is active ? Any
> comments would be really welcome.
>
> Thanks in advance,
>
> - Leny