]> git.8kb.co.uk Git - pgpool-ii/pgpool-ii_2.2.5/blob - test/jdbc/UpdateTest.java
Attempt to send a proper failure message to frontend when authentication
[pgpool-ii/pgpool-ii_2.2.5] / test / jdbc / UpdateTest.java
1 import java.sql.*;
2
3 public class UpdateTest extends PgpoolTest {
4     public void do_test() throws SQLException {
5         int N = 100;
6
7         try {
8             ResultSet rs;
9             Statement stmt = null;
10
11             for (int i = 0; i < N; i++) {
12                 connection.setAutoCommit(false);
13                 stmt = connection.createStatement();
14                 stmt.executeUpdate("UPDATE up SET a = a + 1" );
15                 stmt.close();
16                 connection.commit();
17             }
18             connection.setAutoCommit(true);
19             stmt = connection.createStatement();
20             rs = stmt.executeQuery("SELECT max(a) FROM up" );
21             rs.next();
22             logwriter.println(rs.getInt(1));
23         }
24         finally {
25             connection.close();
26         }
27     }
28
29     public String getTestName() {
30         return "update";
31     }
32 }