question: public static boolean checkConnection ( Connection conn ) { String sql = "select now()" ; Statement stmt = null ; ResultSet rs = null ; try { stmt = conn . createStatement ( ) ; stmt . setQueryTimeout ( 180 ) ; rs = stmt . executeQuery ( sql ) ; if ( rs != null && rs . next ( ) ) return true ; return false ; } catch ( Exception ex ) { } finally { close ( rs ) ; close ( stmt ) ; } return false ; }
target:  Check if the given jdbc connection is still good