At the end I have defeated my laziness and instead of giving advices has written a small piece of code that test claim of original poster - result is quite predictable all 3 variants work flawlessly:
Code:
String testValue = null;
getJdbcTemplate().update(
"INSERT INTO test_table VALUES (?)",
new Object[]{testValue});
getJdbcTemplate().update(
"INSERT INTO test_table VALUES (?)",
new Object[]{ testValue },
new int[]{ NULL });
getJdbcTemplate().update(
"INSERT INTO test_table VALUES (?)",
new Object[]{ testValue },
new int[]{ VARCHAR });
After run of this code TEST_TABLE contains 3 null records
Code:
SQL> set null null
SQL> select * from test_table;
TEST_VALUE
--------------------------------------------------
null
null
null
SQL>
Oracle server 9.2.0.8 JDBC driver 10.2.0.1.
So problem is somewhere else. Please, provide more information - full stack trace and test program code along with DB and JDBC driver versions would be very appreciated.
Regards,
Oleksandr