日期:2014-05-16  浏览次数:20439 次

Cannot convert value '0000-00-00 00:00:00' from column 10 to TIMESTAMP
问题:MySQL数据库,如果数据库中日期字段为空为值为'0000-00-00 00:00:00"时,查询的时候回报:Cannot convert value '0000-00-00 00:00:00' from column 10 to TIMESTAMP



加上zeroDateTimeBehavior=convertToNull参数就可以了
例如:database.url=jdbc\:mysql\://localhost/mega_db_test?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull