import java.sql.*; import java.util.*; public class TestStatementLogging { public static void main(String[] args) throws Exception { Class.forName("org.postgresql.Driver"); Connection conn = DriverManager.getConnection(args[0]); conn.setAutoCommit(false); PreparedStatement stmt = conn.prepareStatement("SELECT 'dummy statement'"); for (int j = 0; j < 10; ++j) stmt.executeQuery(); stmt.close(); stmt = conn.prepareStatement("SELECT * from pg_proc"); stmt.setFetchSize(1); ResultSet rs = stmt.executeQuery(); while (rs.next()) ; stmt.close(); conn.createStatement().execute("I am a syntax error"); } }