PreparedStatement接口中setNull()方法的用法是什么?我看了一下this的帖子。PreparedStatement接口的用法setNull
它说:Without the setNull(..) method there would be no way to set null values for the Java primitives.
然而在JDK5自动装箱,我认为空值可以设置甚至原始类型。
还有另一个post在其他一些论坛上说:If you want to be portable to different databases, use the setNull() method.
但是没有什么用Java文档明确提及。你能帮我理解吗?
“但是在JDK5中使用自动装箱功能时,我认为可以在偶数基本类型上设置空值。” - 错了。自动装箱意味着您可以将原始值分配给对象类型的变量;它不允许您将null传递给采用原语的方法。 – 2011-04-30 13:06:09
是的..我错了。 – Vicky 2011-04-30 15:27:30