Sha256: 26815a7a90dc93f40052b692967cdc3adcdb04dcbeb8e047ebcb1a2c99d341aa

Contents?: true

Size: 753 Bytes

Versions: 12

Compression:

Stored size: 753 Bytes

Contents

import java.sql.*;

public class InsertTest extends PgpoolTest {
    public void do_test() throws SQLException {
	int N = 100;

	try {
	    ResultSet rs;
	    PreparedStatement pstmt = null;
	    Statement stmt = null;

	    for (int i = 0; i < N; i++) {
		connection.setAutoCommit(false);
		pstmt = connection.prepareStatement("INSERT INTO ins VALUES (?)");
		pstmt.setInt(1, i);
		pstmt.executeUpdate();
		pstmt.close();
		connection.commit();
	    }
	    connection.setAutoCommit(true);
	    stmt = connection.createStatement();
	    rs = stmt.executeQuery("SELECT count(a) FROM ins" );
	    rs.next();
	    logwriter.println(rs.getInt(1));
	}
	finally {
	    connection.close();
	}
    }

    public String getTestName() {
	return "insert";
    }
}

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
prestogres-0.4.8 pgpool2/test/jdbc/InsertTest.java
prestogres-0.4.7 pgpool2/test/jdbc/InsertTest.java
prestogres-0.4.6 pgpool2/test/jdbc/InsertTest.java
prestogres-0.4.5 pgpool2/test/jdbc/InsertTest.java
prestogres-0.4.4 pgpool2/test/jdbc/InsertTest.java
prestogres-0.4.3 pgpool2/test/jdbc/InsertTest.java
prestogres-0.4.2 pgpool2/test/jdbc/InsertTest.java
prestogres-0.4.1 pgpool2/test/jdbc/InsertTest.java
prestogres-0.4.0 pgpool2/test/jdbc/InsertTest.java
prestogres-0.3.0 pgpool2/test/jdbc/InsertTest.java
prestogres-0.2.0 pgpool2/test/jdbc/InsertTest.java
prestogres-0.1.0 pgpool2/test/jdbc/InsertTest.java