mirror of
https://github.com/alibaba/canal.git
synced 2026-11-04 00:30:15 +08:00
fix #1521
This commit is contained in:
@@ -52,7 +52,7 @@ public class BatchExecutor implements Closeable {
|
||||
}
|
||||
|
||||
public void execute(String sql, List<Map<String, ?>> values) throws SQLException {
|
||||
PreparedStatement pstmt = getConn().prepareStatement(sql);
|
||||
try (PreparedStatement pstmt = getConn().prepareStatement(sql)) {
|
||||
int len = values.size();
|
||||
for (int i = 0; i < len; i++) {
|
||||
int type = (Integer) values.get(i).get("type");
|
||||
@@ -63,6 +63,7 @@ public class BatchExecutor implements Closeable {
|
||||
pstmt.execute();
|
||||
idx.incrementAndGet();
|
||||
}
|
||||
}
|
||||
|
||||
public void commit() throws SQLException {
|
||||
getConn().commit();
|
||||
|
||||
Reference in New Issue
Block a user