posted 20 years ago
When using the "setNull(...)" method on a PreparedStatement instance, you need to make sure that the type you send in as the second parameter matches the column type in Oracle. In the Oracle documentation (I looked in the 9i PDF from Oracle) they list the datatype mappings, and nowhere on the list do I see "java.sql.Types.OTHER. This may mean it is not supported in Oracle.
But in any case, if the underlying Oracle column is "varchar2", then you most certainly need to use something like "java.sql.Types.VARCHAR" as the second parameter of your "setNull(...)" call.
If you tried to use "java.sql.Types.INT" or "java.sql.Types.TIMESTAMP" in place of "java.sql.Types.OTHER" you'd probably get the same error. The types have to match.