Skip to content

Commit

Permalink
Update StatementUtil.java
Browse files Browse the repository at this point in the history
add nullTypeMap prevent repeat get metadata in loop
  • Loading branch information
fengbugou authored Sep 11, 2020
1 parent d23bdd9 commit 49a85af
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hutool-db/src/main/java/cn/hutool/db/StatementUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,9 @@ public static PreparedStatement prepareStatementForBatch(Connection conn, String
sql = sql.trim();
SqlLog.INSTANCE.log(sql, paramsBatch);
PreparedStatement ps = conn.prepareStatement(sql);
Map<Integer, Integer> nullTypeMap = new HashMap<>();
for (Object[] params : paramsBatch) {
StatementUtil.fillParams(ps, params);
StatementUtil.fillParams(ps, params, nullTypeMap);
ps.addBatch();
}
return ps;
Expand Down

0 comments on commit 49a85af

Please sign in to comment.