List of usage examples for org.springframework.jdbc.core InterruptibleBatchPreparedStatementSetter setValues
void setValues(PreparedStatement ps, int i) throws SQLException;
From source file:com.github.ferstl.spring.jdbc.oracle.BatchingPreparedStatementCallback.java
private void executeUpdate(OraclePreparedStatement ops, InterruptibleBatchPreparedStatementSetter ipss, List<Integer> rowCounts) throws SQLException { ops.setExecuteBatch(this.sendBatchSize); int i = 0;/* w ww . j a v a 2 s . com*/ while (i < ipss.getBatchSize()) { ipss.setValues(ops, i); if (ipss.isBatchExhausted(i)) { break; } rowCounts.add(ops.executeUpdate()); i++; } if (i > 0 && i % this.sendBatchSize != 0) { rowCounts.set(rowCounts.size() - 1, ops.sendBatch()); } }