5 public class BatchTest extends PgpoolTest {
6 public String [] batchSqls = new String[] {
7 "INSERT INTO batch VALUES (1)",
8 "INSERT INTO batch VALUES (1)",
9 "INSERT INTO batch VALUES (1)",
10 "INSERT INTO batch VALUES (1)",
11 "INSERT INTO batch VALUES (1)",
12 "INSERT INTO batch VALUES (1)",
13 "INSERT INTO batch VALUES (1)",
14 "INSERT INTO batch VALUES (1)",
15 "INSERT INTO batch VALUES (1)",
16 "INSERT INTO batch VALUES (1)",
17 "INSERT INTO batch VALUES (1)",
20 public void do_test() throws SQLException {
21 connection.setAutoCommit(false);
23 Statement stmt = null;
28 stmt = connection.createStatement();
29 for(int i=0; i<batchSqls.length; i++) {
30 stmt.addBatch(batchSqls[i]);
32 int [] r = stmt.executeBatch();
37 stmt = connection.createStatement();
38 rs = stmt.executeQuery("SELECT count(*) FROM batch");
40 logwriter.println(rs.getInt(1));
43 if(rs != null) rs.close();
44 if(stmt != null) stmt.close();
52 public String getTestName() {