I'm trying to insert a record into a database using spring JDBC template. In our table there is a column 'VERSION' with data type as NUMBER. We're using Oracle 10g Database.
This is the Value object declaration:
I'm setting the 'VERSION' column value like this:
The 'VERSION' column is a NULLABLE column. There must be null value in a specific business scenario. The problem is instead of 'null' the column is getting updated as '0'. I checked the SQL that is getting executed and the query doesn't contain the 'VERSION' column itself in the insert query.
But if I change the 'version' type as 'String' in value object and do preparedStatement.setString(5, valueObj.getVersion()); , the 'VERSION' column is having the null value correctly.
My problem is even if I use Integer object the 'VERSION' column should have null value in the database.
Can you please resolve me this issue?
I AM MIGHTY! Especially when I hold this tiny ad:
a bit of art, as a gift, that will fit in a stocking