在我的表定義中,有一個int數據類型的列。如果值爲「0」,我希望jdbcTemplate更新方法默認情況下使用「NULL」而不是「0」來更新此字段。Spring JDBC模板更新問題
this.jdbcTemplate.update("UPDATE GCUR_OBSERVATION "
+ "SET ObserverId = ?," + "ObservationDate = ?,"
+ "PointCuring = ?"
+ " WHERE locationId = ? AND ObservationStatus = 0",
new Object[] { new Integer(newObservation.getObserverId()),
newObservation.getObservationDate(),
new Integer(newObservation.getLocationId()) });
上面的代碼段運行良好時Point Curing
是not NULL
。但是,如何將其作爲NULL
存儲在數據庫表中?