use of herddb.client.DMLResult in project herddb by diennea.
the class HerdDBPreparedStatement method executeBatch.
@Override
public int[] executeBatch() throws SQLException {
try {
int[] results = new int[batch.size()];
int i = 0;
lastUpdateCount = 0;
parent.discoverTableSpace(sql);
List<DMLResult> dmlresults = parent.getConnection().executeUpdates(parent.getTableSpace(), sql, parent.ensureTransaction(), false, true, this.batch);
for (DMLResult dmlresult : dmlresults) {
results[i++] = (int) dmlresult.updateCount;
parent.bindToTransaction(dmlresult.transactionId);
lastUpdateCount += dmlresult.updateCount;
lastKey = dmlresult.key;
}
return results;
} catch (ClientSideMetadataProviderException | HDBException err) {
throw SQLExceptionUtils.wrapException(err);
} finally {
batch.clear();
}
}
Aggregations