mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-07 09:08:24 +08:00
fix: optimize SqlArgsParameterHandler.java
This commit is contained in:
parent
6fde8b613e
commit
3e1014b87d
@ -64,7 +64,10 @@ public class SqlArgsParameterHandler extends DefaultParameterHandler {
|
|||||||
for (Object value : sqlArgs) {
|
for (Object value : sqlArgs) {
|
||||||
// 设置 NULL 值
|
// 设置 NULL 值
|
||||||
if (value == 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;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user