1.

How Do I Insert/update Records With Some Of The Columns Having Null Value?

Answer»

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

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.

 

Use either of the following PreparedStatement methods:

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.

 



Discussion

No Comment Found