"select 1" should be ok for all db's, it is legitimate ANSI SQL. However I know you're looking at DBCP in commons, and suggest that you look at Connection.isClosed(), it then becomes the responsibility of the JDBC driver to check the connection. I don't know what different drivers do for this, but I seem to recal that mm.MySQL will test the connection, and expect that others will do so also, although the JDBC2 javadocs are vague "Tests to see if a Connection is closed" about whether this should physically test the connection or simply report whether close() has been called yet.
Normally I don't like doing this because of the extra round-trips, but especially in James, where we have a small set of SQL statements, the errors are going to be catastrophic and this kind of check is overkill. I would bet with the SQL we have, these needless extra roundtrips would cause 20%+ degredation in performance.
This isn't really that hard though... when you do isClosed() or prepareStatement() on the connection and it throws an exception, **don't stick it back in the pool**.
-- Serge Knystautas President Lokitech >> software . strategy . design >> http://www.lokitech.com p. 301.656.5501 e. [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
