question: public void testBug71672Statement ( int testStep , Connection testConn , String query , int expectedUpdateCount , int [ ] expectedKeys ) throws SQLException { Statement testStmt = testConn . createStatement ( ) ; if ( expectedUpdateCount < 0 ) { assertFalse ( testStep + ". Stmt.execute() result" , testStmt . execute ( query , Statement . RETURN_GENERATED_KEYS ) ) ; } else { assertEquals ( testStep + ". Stmt.executeUpdate() result" , expectedUpdateCount , testStmt . executeUpdate ( query , Statement . RETURN_GENERATED_KEYS ) ) ; } ResultSet testRS = testStmt . getGeneratedKeys ( ) ; for ( int k : expectedKeys ) { assertTrue ( testStep + ". Row expected in generated keys ResultSet" , testRS . next ( ) ) ; assertEquals ( testStep + ". Wrong generated key" , k , testRS . getInt ( 1 ) ) ; } assertFalse ( testStep + ". No more rows expected in generated keys ResultSet" , testRS . next ( ) ) ; testRS . close ( ) ; testStmt . close ( ) ; }
target:  Check the update count and returned keys for an INSERT query using a Statement object. If expectedUpdateCount < 0 then runs Statement.execute() otherwise Statement.executeUpdate().