I have a column in Oracle table which is of type NUMBER ( and it can be null ). Inorder to insert values , I create a PreparedStatement object and when I try to set the value for this column I get an invalid column type error. The code snippet is as below
preparedStatement.setObject ( paramIndex , args[i] ); where args[i] is null.
NUMBER is not an object for database. It should be a number or nothing(NULL). we cant do like setObject(index, null). And you cant set 'null' in setInt() method. So, setNull() is the right method to use, but it requires the type of the column not the type of 'null'.