Browse Source

调整NamedParameterJdbcTemplate的调用参数

CodeLife Leno 2 months ago
parent
commit
9cab27d951

+ 3 - 7
Procedure/backend/project/src/main/java/com/sundata/product/taskExecute/service/KingBase2GBaseService.java

@@ -82,19 +82,15 @@ public class KingBase2GBaseService {
         String sql = "insert into " + tableName + "(" + insertSqlKey + ") values(" + insertSqlValue + ")";
         log.debug("执行的SQL为:{}", sql);
         MapSqlParameterSource sqlParam;
-        otherJdbc.update("delete from " + tableName);
+        otherJdbc.update("delete from " + tableName,new MapSqlParameterSource());
         int x = 0;
         for (Map<String, Object> map : data) {
             otherJdbc.update(sql, new MapSqlParameterSource(map));
             if (x++ % 10 == 0) {
-                otherJdbc.execute("commit", (o) -> {
-                    o.execute();
-                });
+                otherJdbc.update("commit", new MapSqlParameterSource());
             }
         }
-        otherJdbc.execute("commit", (o) -> {
-            o.execute();
-        });
+        otherJdbc.update("commit", new MapSqlParameterSource());
     }