I have a table in MYSQL and I use JDBC Templates to insert into this table.
One of the columns has a default value, and I do not indicate it on the map Map<String, Object> parameters .
I get a Column 'colName' cannot be null exception Column 'colName' cannot be null .
Can someone explain this please?
thanks
* Change: code *
contactDetailsInsertTemplate = new SimpleJdbcInsert( dataSource ).withTableName("contactdetails").usingGeneratedKeyColumns("contactcode"); Map<String, Object> parameters = new HashMap<String, Object>(); Number newId = contactDetailsInsertTemplate.executeAndReturnKey(parameters);
java spring sql mysql jdbctemplate
Gleeb
source share