How do I insert/update records with some of the columns having NULL value?
Location: http://www.jguru.com/faq/view.jsp?EID=545700 Created: Nov 12, 2001 Author: Harikrishna Neerkaje (http://www.jguru.com/guru/viewbio.jsp?EID=69829) Question originally posed by Tuan Truong (http://www.jguru.com/guru/viewbio.jsp?EID=32991 Use either of the following PreparedStatement methods: public void setNull(int parameterIndex, int sqlType) throws SQLException public void setNull(int paramIndex, int sqlType, String typeName) throws SQLException Joe Sam Shirah adds: Note that these methods assume that the columns are nullable. In this case, you can also just omit the columns in an INSERT statement; they will be automatically assigned null values.