@ Override public boolean exists ( String pid ) throws LowlevelStorageException { Connection connection = null ; PreparedStatement statement = null ; ResultSet rs = null ; try { connection = connectionPool . getReadOnlyConnection ( ) ; statement = connection . prepareStatement ( selectByIdQuery ) ; statement . setString ( 1 , pid ) ; rs = statement . executeQuery ( ) ; return rs . next ( ) ; } catch ( SQLException e1 ) { throw new LowlevelStorageException ( true , "sql failure (get)" , e1 ) ; } finally { try { if ( rs != null ) { rs . close ( ) ; } if ( statement != null ) { statement . close ( ) ; } if ( connection != null ) { connectionPool . free ( connection ) ; } } catch ( Exception e2 ) { // purposely general to include uninstantiated statement, connection throw new LowlevelStorageException ( true , "sql failure closing statement, connection, pool (get)" , e2 ) ; } finally { rs = null ; statement = null ; connection = null ; } } }
Checks to see whether a pid exists in the registry . Makes no audits of the number of registrations or the paths registered .