Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into feature/#135-run-scri…
Browse files Browse the repository at this point in the history
…pt-with-multiple-statements
  • Loading branch information
kaklakariada committed Sep 24, 2024
2 parents d25976e + db6e18d commit 5da2c30
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public void truncate(final Table table) {
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 (AutoCommit autoCommit = AutoCommit.tryDeactivate(connection);
try (final 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 5da2c30

Please sign in to comment.