
控制臺打印日志:2015-08-31 18:29:13 DEBUG com.defonds.bdp.city.service.CityService:45 - before insert the first city2015-08-31 18:29:13 DEBUG com.defonds.bdp.city.mapper.CityMapper.insertCity:54 - ==> Preparing: insert into city_code_cn (city_code, city_jb, province_code, city_name, city, province) values ( ?, ?, ?, ?, ?, ? ) 2015-08-31 18:29:13 DEBUG com.defonds.bdp.city.mapper.CityMapper.insertCity:54 - ==> Parameters: 1100(String), 1(String), 1100(String), 天津市(String), 天津市(String), 天津市(String)2015-08-31 18:29:13 DEBUG com.defonds.bdp.city.mapper.CityMapper.insertCity:54 - <== Updates: 12015-08-31 18:29:13 DEBUG com.defonds.bdp.city.service.CityService:47 - after insert the first city, and before insert the second city2015-08-31 18:29:13 DEBUG com.defonds.bdp.city.mapper.CityMapper.insertCity:54 - ==> Preparing: insert into city_code_cn (city_code, city_jb, province_code, city_name, city, province) values ( ?, ?, ?, ?, ?, ? ) 2015-08-31 18:29:13 DEBUG com.defonds.bdp.city.mapper.CityMapper.insertCity:54 - ==> Parameters: null, null, null, null, null, null2015-08-31 18:29:13 ERROR com.defonds.bdp.city.controller.CityController:97 - org.springframework.dao.DataIntegrityViolationException: ### Error updating database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column 'CITY_CODE' cannot be null### The error may involve com.defonds.bdp.city.mapper.CityMapper.insertCity-Inline### The error occurred while setting parameters### SQL: insert into city_code_cn (city_code, city_jb, province_code, city_name, city, province) values ( ?, ?, ?, ?, ?, ? )### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column 'CITY_CODE' cannot be null; SQL []; Column 'CITY_CODE' cannot be null; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column 'CITY_CODE' cannot be null查看 db 的 CITY_CODE_CN 表,沒有新記錄插入,spring 4 + mybatis 3 成功。新聞熱點
疑難解答