这个问题是解决以下问题出现的:
java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp
问题原因是因为JDBC
url=jdbc:mysql://xxx.aliyuncs.com:3306/xxxxx?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull
错误信息中已经提示了 zeroDateTimeBehavior 属性可以接受 'exception', 'round' or 'convertToNull'中的一个。
默认是 exception,抛出异常
round 是返回:0001-01-01 00:00:00.0
convertToNull 就是转换为 null
转自:http://blog.csdn.net/testcs_dn/article/details/64922792