private void cleanupConnection ( Connection conn , ResultSet rs , PreparedStatement statement ) { logger . logp ( Level . FINEST , CLASSNAME , "cleanupConnection" , "Entering" , new Object [ ] { conn , rs == null ? "<null>" : rs , statement == null ? "<null>" : statement } ) ; if ( statement != null ) { try { statement . close ( ) ; } catch ( SQLException e ) { throw new PersistenceException ( e ) ; } } if ( rs != null ) { try { rs . close ( ) ; } catch ( SQLException e ) { throw new PersistenceException ( e ) ; } } if ( conn != null ) { try { conn . close ( ) ; } catch ( SQLException e ) { throw new PersistenceException ( e ) ; } finally { try { conn . close ( ) ; } catch ( SQLException e ) { throw new PersistenceException ( e ) ; } } } logger . logp ( Level . FINEST , CLASSNAME , "cleanupConnection" , "Exiting" ) ; }
closes connection result set and statement