Hi,
Originally posted by shilpa kulkarni:
USE :
CallableStatement cst = connection.prepareCall(.....);
cst.setNull(parameterIndex, sqlType);
see PreapredStatement.setNull() :-
public void setNull(int parameterIndex, int sqlType)
throws SQLException
Sets the designated parameter to SQL NULL.
Note: You must specify the parameter's SQL type.
Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
sqlType - the SQL type code defined in java.sql.Types
Throws:
SQLException - if a database access error occurs
I used the aforesaid method to set null. But it throwed an SQLException saying "column type error" or something of that sort which i could only perceive as the datatype didn't match. Hence i used the setFloat method(since the column is a float) and passed null as parameter. know what happened. It got stored as 0.
Thanks,
Arjun