Skip to content

Commit

Permalink
Fix compiler error
Browse files Browse the repository at this point in the history
  • Loading branch information
kaklakariada committed Sep 24, 2024
1 parent b249feb commit 7908f6d
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,11 @@ public void truncate(final Table table) {
protected abstract String getQuotedColumnName(String columnName);

@Override
@SuppressWarnings("try") // autoCommit never referenced in try block by intention
public void write(final Table table, final Stream<List<Object>> rows) {
final String valuePlaceholders = "?" + ", ?".repeat(table.getColumnCount() - 1);
final String sql = "INSERT INTO " + table.getFullyQualifiedName() + " VALUES(" + valuePlaceholders + ")";

try (@SuppressWarnings("try") // autoCommit never referenced in try block by intention
AutoCommit autoCommit = AutoCommit.tryDeactivate(connection);
try (AutoCommit autoCommit = AutoCommit.tryDeactivate(connection);
final PreparedStatement preparedStatement = this.connection.prepareStatement(sql)) {
rows.forEach(row -> addBatch(table, preparedStatement, row));
preparedStatement.executeBatch();
Expand Down

0 comments on commit 7908f6d

Please sign in to comment.