I have a table in MYSQL and I am using JDBC Templates to do an insert into that table.
One of the columns has a default value, and I am not specifying it in the Map<String, Object> parameters
map.
I am getting an exception Column 'colName' cannot be null
.
Can anyone explain this please?
Thanks
*Edit: code *
contactDetailsInsertTemplate = new SimpleJdbcInsert( dataSource ).withTableName("contactdetails").usingGeneratedKeyColumns("contactcode"); Map<String, Object> parameters = new HashMap<String, Object>(); Number newId = contactDetailsInsertTemplate.executeAndReturnKey(parameters);