Skip to content

Commit

Permalink
#30 more inlining for batch processing
Browse files Browse the repository at this point in the history
  • Loading branch information
doom369 committed Sep 8, 2019
1 parent 015cf2a commit 39fe2c6
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -297,12 +297,7 @@ public void setObject(int parameterIndex, Object x) throws SQLException {

@Override
public void addBatch() throws SQLException {
Collections.addAll(batchRows, buildBatch());
}

private byte[][] buildBatch() throws SQLException {
checkBinded();
byte[][] newBatch = new byte[parameterList.length][];
StringBuilder sb;
for (int i = 0, p = 0; i < parameterList.length; i++) {
sb = new StringBuilder();
Expand All @@ -322,9 +317,9 @@ private byte[][] buildBatch() throws SQLException {
char appendChar = j < batchParamsLength - 1 ? '\t' : '\n';
sb.append(appendChar);
}
newBatch[i] = sb.toString().getBytes(UTF_8);
byte[] batchBytes = sb.toString().getBytes(UTF_8);
batchRows.add(batchBytes);
}
return newBatch;
}

@Override
Expand Down

0 comments on commit 39fe2c6

Please sign in to comment.