question: public static int findNextConsistencyId ( Database conn , Table ct ) throws Exception { int id = 1 ; try { Statement st ; st = conn . createStatement ( ) ; ResultSet rs = st . executeQuery ( "SELECT MAX(" + ConsistencyTable . idColumnName + ") FROM " + ct . getSchema ( ) + "." + ct . getName ( ) ) ; if ( rs . next ( ) ) { id = rs . getInt ( 1 ) + 1 ; } rs . close ( ) ; st . close ( ) ; } catch ( Exception e ) { logger . error ( "Failed to query last consistency check ID: " + e . getMessage ( ) ) ; throw e ; } return id ; }
target:  Finds what ID should be used for the next consistency check.