public void testBug39426() throws Exception {
  Connection c=null;
  try {
    createTable("testBug39426","(x int)");
    c=getConnectionWithProps("statementInterceptors=testsuite.regression.StatementRegressionTest$Bug39426Interceptor,useServerPrepStmts=false");
    PreparedStatement ps=c.prepareStatement("insert into testBug39426 values (?)");
    ps.setInt(1,1);
    ps.addBatch();
    ps.setInt(1,2);
    ps.addBatch();
    ps.setInt(1,3);
    ps.addBatch();
    ps.executeBatch();
    List<Integer> vals=Bug39426Interceptor.vals;
    assertEquals(new Integer(1),vals.get(0));
    assertEquals(new Integer(2),vals.get(1));
    assertEquals(new Integer(3),vals.get(2));
  }
  finally {
    if (c != null) {
      c.close();
    }
  }
}

public void testBug39426 ( ) throws Exception { Connection c = null ; try { createTable ( "testBug39426" , "(x int)" ) ; c = getConnectionWithProps ( "statementInterceptors=testsuite.regression.StatementRegressionTest$Bug39426Interceptor,useServerPrepStmts=false" ) ; PreparedStatement ps = c . prepareStatement ( "insert into testBug39426 values (?)" ) ; ps . setInt ( 1 , 1 ) ; ps . addBatch ( ) ; ps . setInt ( 1 , 2 ) ; ps . addBatch ( ) ; ps . setInt ( 1 , 3 ) ; ps . addBatch ( ) ; ps . executeBatch ( ) ; List < Integer > vals = Bug39426Interceptor . vals ; assertEquals ( new Integer ( 1 ) , vals . get ( 0 ) ) ; assertEquals ( new Integer ( 2 ) , vals . get ( 1 ) ) ; assertEquals ( new Integer ( 3 ) , vals . get ( 2 ) ) ; } finally { if ( c != null ) { c . close ( ) ; } } }
bug # 39426 - executebatch passes most recent preparedstatement params to statementinterceptor
