private void synchronousDestroyStatement( final Object pstmt ) { StatementUtils.attemptClose( (PreparedStatement) pstmt ); }
final void synchronousDestroyStatement( final Object pstmt ) { StatementUtils.attemptClose( (PreparedStatement) pstmt ); }
private void synchronousDestroyStatement( final Object pstmt ) { StatementUtils.attemptClose( (PreparedStatement) pstmt ); }
final void synchronousDestroyStatement( final Object pstmt ) { StatementUtils.attemptClose( (PreparedStatement) pstmt ); }
static void executeDelete(Connection con) throws SQLException { Statement stmt = null; try { stmt = con.createStatement(); stmt.executeUpdate("DELETE FROM testpbds;"); System.out.println("DELETION"); } finally { StatementUtils.attemptClose( stmt ); } }
static void executeDelete(Connection con) throws SQLException { Statement stmt = null; try { stmt = con.createStatement(); stmt.executeUpdate("DELETE FROM testpbds;"); System.out.println("DELETION"); } finally { StatementUtils.attemptClose( stmt ); } }
long test(Connection con, int n) throws SQLException { long start; long end; Statement stmt = null; start = System.currentTimeMillis(); for (int i = 0; i < n; ++i) { try { stmt = con.createStatement(); } finally { StatementUtils.attemptClose( stmt ); } } end = System.currentTimeMillis(); return end - start; } }
long test(Connection con, int n) throws SQLException { long start; long end; Statement stmt = null; start = System.currentTimeMillis(); for (int i = 0; i < n; ++i) { try { stmt = con.createStatement(); } finally { StatementUtils.attemptClose( stmt ); } } end = System.currentTimeMillis(); return end - start; } }
static void executeInsert(Connection con, Random random) throws SQLException { Statement stmt = null; try { stmt = con.createStatement(); stmt.executeUpdate("INSERT INTO testpbds VALUES ('" + random.nextInt() + "', '" + random.nextInt() + "')"); System.out.println("INSERTION"); } finally { StatementUtils.attemptClose( stmt ); } }
static void executeInsert(Connection con, Random random) throws SQLException { Statement stmt = null; try { stmt = con.createStatement(); stmt.executeUpdate("INSERT INTO testpbds VALUES ('" + random.nextInt() + "', '" + random.nextInt() + "')"); System.out.println("INSERTION"); } finally { StatementUtils.attemptClose( stmt ); } }
static void drop(DataSource ds) throws SQLException { Connection con = null; Statement stmt = null; try { con = ds.getConnection(); stmt = con.createStatement(); stmt.executeUpdate("DROP TABLE TRSS_TABLE"); } finally { StatementUtils.attemptClose( stmt ); ConnectionUtils.attemptClose( con ); } }
static void executeInsert(Connection con, Random random) throws SQLException { PreparedStatement pstmt = null; try { pstmt = con.prepareStatement(INSERT_STMT); pstmt.setInt(1, random.nextInt()); pstmt.setInt(2, random.nextInt()); pstmt.executeUpdate(); System.out.println("INSERTION"); } finally { // make sure forgetting this doesn't starve // statement cache, as long as the connection // closes... StatementUtils.attemptClose( pstmt ); } }
static void executeInsert(Connection con) throws SQLException { PreparedStatement pstmt = null; try { pstmt = con.prepareStatement(INSERT_STMT); pstmt.setInt(1, random.nextInt()); pstmt.setInt(2, random.nextInt()); pstmt.executeUpdate(); System.out.println("INSERTION"); } finally { // make sure forgetting this doesn't starve // statement cache, as long as the connection // closes... StatementUtils.attemptClose( pstmt ); } }
static void drop(DataSource ds) throws SQLException { Connection con = null; PreparedStatement ps1 = null; try { con = ds.getConnection(); ps1 = con.prepareStatement(EMPTY_TABLE_DROP); ps1.executeUpdate(); } finally { StatementUtils.attemptClose( ps1 ); ConnectionUtils.attemptClose( con ); } System.err.println("Test schema dropped."); } }
static void executeInsert(Connection con) throws SQLException { PreparedStatement pstmt = null; try { pstmt = con.prepareStatement(INSERT_STMT); pstmt.setInt(1, random.nextInt()); pstmt.setInt(2, random.nextInt()); pstmt.executeUpdate(); System.out.println("INSERTION"); } finally { // make sure forgetting this doesn't starve // statement cache, as long as the connection // closes... StatementUtils.attemptClose( pstmt ); } }
static void executeInsert(Connection con, Random random) throws SQLException { PreparedStatement pstmt = null; try { pstmt = con.prepareStatement(INSERT_STMT); pstmt.setInt(1, random.nextInt()); pstmt.setInt(2, random.nextInt()); pstmt.executeUpdate(); System.out.println("INSERTION"); } finally { // make sure forgetting this doesn't starve // statement cache, as long as the connection // closes... StatementUtils.attemptClose( pstmt ); } }
static void executeDelete(Connection con, Random random) throws SQLException { PreparedStatement pstmt = null; ResultSet rs = null; try { pstmt = con.prepareStatement(DELETE_STMT); int deleted = pstmt.executeUpdate(); System.out.println("DELETE [" + deleted + " rows]"); } finally { ResultSetUtils.attemptClose( rs ); StatementUtils.attemptClose( pstmt ); } }
static void create(DataSource ds) throws SQLException { Connection con = null; Statement stmt = null; try { con = ds.getConnection(); stmt = con.createStatement(); stmt.executeUpdate("CREATE TABLE TRSS_TABLE ( a_col VARCHAR(16) )"); } finally { StatementUtils.attemptClose( stmt ); ConnectionUtils.attemptClose( con ); } }
static void create(DataSource ds) throws SQLException { Connection con = null; Statement stmt = null; try { con = ds.getConnection(); stmt = con.createStatement(); stmt.executeUpdate("CREATE TABLE TRSS_TABLE ( a_col VARCHAR(16) )"); } finally { StatementUtils.attemptClose( stmt ); ConnectionUtils.attemptClose( con ); } }
static void drop(DataSource ds) throws SQLException { Connection con = null; Statement stmt = null; try { con = ds.getConnection(); stmt = con.createStatement(); stmt.executeUpdate("DROP TABLE TRSS_TABLE"); } finally { StatementUtils.attemptClose( stmt ); ConnectionUtils.attemptClose( con ); } }