private CheckpointData queryCheckpointData ( Object key ) { logger . entering ( CLASSNAME , "queryCheckpointData" , new Object [ ] { key , SELECT_CHECKPOINTDATA } ) ; Connection conn = null ; PreparedStatement statement = null ; ResultSet rs = null ; ObjectInputStream objectIn = null ; CheckpointData data = null ; try { conn = getConnection ( ) ; statement = conn . prepareStatement ( SELECT_CHECKPOINTDATA ) ; statement . setObject ( 1 , key ) ; rs = statement . executeQuery ( ) ; if ( rs . next ( ) ) { byte [ ] buf = rs . getBytes ( "obj" ) ; data = ( CheckpointData ) deserializeObject ( buf ) ; } } catch ( SQLException e ) { throw new PersistenceException ( e ) ; } catch ( IOException e ) { throw new PersistenceException ( e ) ; } catch ( ClassNotFoundException e ) { throw new PersistenceException ( e ) ; } finally { if ( objectIn != null ) { try { objectIn . close ( ) ; } catch ( IOException e ) { throw new PersistenceException ( e ) ; } } cleanupConnection ( conn , rs , statement ) ; } logger . exiting ( CLASSNAME , "queryCheckpointData" ) ; return data ; }
select data from DB table