tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vy Ho <st946...@drexel.edu>
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?

Thanks.

vh


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message