您的位置:首页 > 产品设计 > UI/UE

SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp

2018-01-05 21:59 501 查看
这个问题是解决以下问题出现的:

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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
相关文章推荐