Sha256: 3643ba43465a8b11b360d4de1e5a90b723763b9d6b57e74dbcbf1c16d8b8f1eb
Contents?: true
Size: 1.18 KB
Versions: 12
Compression:
Stored size: 1.18 KB
Contents
import java.util.*; import java.io.*; import java.sql.*; public class AutoCommitTest extends PgpoolTest{ public String sql = "select * from autocommit where a = ?"; public static void main(String[] args) throws SQLException { AutoCommitTest test = new AutoCommitTest(); test.do_test(); } public void do_test() throws SQLException { connection.setAutoCommit(true); PreparedStatement stmt = null; ResultSet rs = null; try { for(int i = 0; i < 10; i++) { stmt = connection.prepareStatement(sql); try { stmt.setInt(1, i + 1); rs = stmt.executeQuery(); while(rs.next()){ logwriter.print(rs.getInt(1) + " "); } logwriter.println(); } finally { if(rs != null) rs.close(); if(stmt != null) stmt.close(); } } } finally { connection.close(); logwriter.close(); } } public String getTestName() { return "autocommit"; } }
Version data entries
12 entries across 12 versions & 1 rubygems