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