@Override public void clearBatch() throws SQLException { targetStatement.clearBatch(); }
@Override public void clearBatch() throws SQLException { statement.clearBatch(); }
@Override public void clearBatch() throws SQLException { delegate.clearBatch(); }
public void clearBatch() throws SQLException { stmt.clearBatch(); }
@Override public final void clearBatch() throws SQLException { if (closed) { return; } try { stmt.clearBatch(); } catch (Throwable t) { throw checkException(t); } }
public void clearBatch() throws SQLException { if (batchSize != 0) { reset(); } delegate.clearBatch(); }
@Override public Object call() throws Exception { stmt2.clearBatch(); return null; } }, SQLException.class, "Statement is closed.");
@Override public void statement_clearBatch(StatementProxy statement) throws SQLException { if (this.pos < filterSize) { nextFilter().statement_clearBatch(this, statement); return; } statement.getRawObject().clearBatch(); }
/** * Verifies that emty batch can be performed. * * @throws Exception If failed. */ @org.junit.Test public void testBatchEmpty() throws Exception { assert conn.getMetaData().supportsBatchUpdates(); stmt.addBatch(""); stmt.clearBatch(); // Just verify that no exception have been thrown. stmt.executeBatch(); }
/** * @throws SQLException If failed. */ @Test public void testBatchClear() throws SQLException { final int BATCH_SIZE = 7; for (int idx = 0, i = 0; i < BATCH_SIZE; ++i, idx += i) { stmt.addBatch("insert into Person (_key, id, firstName, lastName, age) values " + generateValues(idx, i + 1)); } stmt.clearBatch(); int[] updates = stmt.executeBatch(); assertEquals("Returned update counts array should have no elements for empty batch.", 0, updates.length); }
/** * @throws Exception If failed. */ @Test public void testClearBatch() throws Exception { try (Statement stmt = conn.createStatement()) { GridTestUtils.assertThrows(log, new Callable<Object>() { @Override public Object call() throws SQLException { return stmt.executeBatch(); } }, SQLException.class, "Batch is empty"); stmt.addBatch("INSERT INTO Person(_key, id, firstName, lastName, age, data) " + "VALUES ('p1', 0, 'J', 'W', 250, RAWTOHEX('W'))"); stmt.clearBatch(); GridTestUtils.assertThrows(log, new Callable<Object>() { @Override public Object call() throws SQLException { return stmt.executeBatch(); } }, SQLException.class, "Batch is empty"); } } }
@Override public void clearBatch() throws SQLException { stmt.clearBatch(); }
@Override public void clearBatch() throws SQLException { delegate.clearBatch(); }
@Override public void clearBatch() throws SQLException { this.innerStatement.clearBatch(); }
@Override public final void clearBatch() throws SQLException { if (closed) { return; } try { stmt.clearBatch(); } catch (Throwable t) { throw checkException(t); } }
@Override public void statement_clearBatch(StatementProxy statement) throws SQLException { if (this.pos < filterSize) { nextFilter().statement_clearBatch(this, statement); return; } statement.getRawObject().clearBatch(); }
@Override public void clearBatch() throws SQLException { logger.logf(level, "%s.clearBatch()", statementID); statement.clearBatch(); }
@Override public void clearBatch() throws SQLException { if (batchSqlList != null) { batchSqlList.clear(); } delegate.clearBatch(); }
@Override protected void onEnd(Statement statement) throws SQLException { int[] updateCount = statement.executeBatch(); statement.clearBatch(); }
@Override public void clearBatch() throws SQLException { checkOpen(); try { statement.clearBatch(); } catch (final SQLException e) { handleException(e); } }