commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject How to know PreparedStatement is OK when returning it to pool?
Date Mon, 01 Dec 2003 10:31:39 GMT
I am developing a webapp using tomcat and an oracle database, and was looking 
for a preparedStatementPool as my application will have long and complex SQL 
calls, and then I found commons-dbcp.

After having read the javadoc and searched the mailing list archive, I have some 

(1) If I get an SQLException while working with a borrowed PreparedStatement (or 
Connection), how do I know it is well before returning it to the pool? Or is 
there some magic involved so that I do not have to worry about it?

(2) Is there a (generic) way to detect that the database is down (in order to 
display an error message to the user)?

(3) If the database goes down, will the pool automagically try to reconnect with 
some interval, or is that up to the JDBC driver?

I am a newbie to JDBC and pooling, so if this is discussed already somewhere, 
please point me to that.

Best regards

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message