fix: optimize SqlArgsParameterHandler.java

This commit is contained in:
Michael Yang 2024-03-03 15:12:16 +08:00
parent 6fde8b613e
commit 3e1014b87d

View File

@ -64,7 +64,10 @@ public class SqlArgsParameterHandler extends DefaultParameterHandler {
for (Object value : sqlArgs) {
// 设置 NULL
if (value == null) {
ps.setNull(index++, Types.NULL);
// ps.setNull(index++, Types.NULL);
// 此处不应该使用 setNull(index++, Types.NULL)通过 setObject 传入 null jdbc 驱动自行验证类型即可
// 使用 setNull db2 等数据库下Types.NULL 并非其需要类型
ps.setObject(index++, null);
continue;
}