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 {
|
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();
|
int len = values.size();
|
||||||
for (int i = 0; i < len; i++) {
|
for (int i = 0; i < len; i++) {
|
||||||
int type = (Integer) values.get(i).get("type");
|
int type = (Integer) values.get(i).get("type");
|
||||||
@@ -63,6 +63,7 @@ public class BatchExecutor implements Closeable {
|
|||||||
pstmt.execute();
|
pstmt.execute();
|
||||||
idx.incrementAndGet();
|
idx.incrementAndGet();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void commit() throws SQLException {
|
public void commit() throws SQLException {
|
||||||
getConn().commit();
|
getConn().commit();
|
||||||
|
|||||||
Reference in New Issue
Block a user