import testsuite.BaseTestCase; import java.sql.PreparedStatement; public class bug30550 extends BaseTestCase { public bug30550(String name) { super(name); } public static void main(String[] args) { junit.textui.TestRunner.run(bug30550.class); } public void testBug29893() throws Exception { try { this.stmt.executeUpdate("DROP TABLE if exists batchtest"); this.stmt.executeUpdate("CREATE TABLE `batchtest` (id int, data varchar(255))"); this.conn.setAutoCommit(false); PreparedStatement my_pstmt = this.conn.prepareStatement("insert into batchtest (id, data) values (?, ?)"); my_pstmt.executeBatch(); // *** CASE 1 *** for (int id = 1; id <= 100; id++) { my_pstmt.clearParameters(); my_pstmt.setInt(1, id); my_pstmt.setString(2, "data" + id); my_pstmt.addBatch(); } my_pstmt.executeBatch(); my_pstmt.executeBatch(); // *** CASE 2 *** this.conn.commit(); my_pstmt.close(); } finally { closeMemberJDBCResources(); } } }