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
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
相关文章推荐
- java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp
- java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp
- Cash Loan(二):SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp
- 关于SQLException:Value'0000-00-00 00:00:00'can not be represented as java.sql.Timestamp的问题
- java.sql.SQLException:Value ’0000-00-00′ can not be represented as java.sql.Date
- Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp
- Value '0000-00-00' can not be represented as java.sql.Timestamp错误
- hiERROR: Value '0000-00-00' can not be represented as java.sql.Timestamp
- 错误:Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp;的解决
- Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp
- 错误:Value \'0000-00-00 00:00:00\' can not be represented as java.sql.Timestamp;的解决
- Bug3: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp 时间戳错误 时间戳不能被体现
- 开发问题:error: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp
- Value '0000-00-00' can not be represented as java.sql.Timestamp
- 提示Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp;
- 异常java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp
- 异常:java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp
- MySQL异常: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp
- ERROR: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp
- Err:java.sql.SQLException: Value '0000-00-00' can not be represented as java.sql.Timestamp