Search code examples
db2relational-databasexpageslotus-domino

Xpages using @jdbcupdate cant set timestamp field to null


I am using for a project @jdbcupdate from extension library , but I cant set to null a TIMESTAMP field.

Example: I have a record in a table with a timestamp field set to 16/04/2018 15:52:18 and want set to null

@JdbcUpdate(conndb,db2tablename,saveobject,fieldcondizione,id)

saveobject is an HashMap where I try to force to null

saveobject.put(Key,"0000-00-00 00:00:00" )

but in the timestamp field it write 30/11/0002 00:00:00 instead of null.

There is a way to set to null a timestamp field or Date field with the relational control of Extension library for DB2 ?

Thanks in advance


Solution

  • Hashmap supports null values and null keys according to its documentation. i.e. you can put null into the HashMap entry( saveobject.put(Key, null); )

    But if the target column has 'not null with default' then Db2 will use the default.