[英]Setting null value to Integer column field in Prepared Statement Setter
Till I know, the correct way to do this is: 直到我知道,正确的方法是:
ps.setNull(1, java.sql.Types.INTEGER);
However, on execution, my database column value is showing 4 instead of null. 但是,执行时,我的数据库列值显示为4而不是null。
On checking found that 4 is the static constant value for Types INTEGER. 经检查发现4是类型INTEGER的静态常数。
Where could be the issue ? 问题可能在哪里?
Is it related to driver ? 与驱动程序有关吗?
The database is DB2. 该数据库是DB2。
可能有一个触发器,可以在插入或更新时修改数据。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.