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