tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vy Ho <>
Subject What is the best way to test JDBC connection for alive
Date Wed, 23 Jun 2004 14:21:32 GMT
If I have a connection, I want to test if it's still working (not just 
see if it's closed), how do I do this with the least CPU/resource cost?  
I saw one tutorial did something like:

stmt = conn.createStatement();
      if( null != stmt )
        stmt.execute("rollback work");

If an exception is thrown, then it's not good.  What's the implication 
of this statement (bad implication)?  Is there alternative?



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

View raw message