### Cause: java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp
; SQL []; Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp; nested exception is java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp
org.springframework.dao.TransientDataAccessResourceException:
### Error querying database. Cause: java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp
最简单的解决办法:
在jdbc的连接中增加:zeroDateTimeBehavior=convertToNull
本文介绍了一种常见的数据库操作错误——无法将'0000-00-00 00:00:00'解析为Java Timestamp类型的问题及其解决方案。通过在JDBC连接字符串中添加参数'zeroDateTimeBehavior=convertToNull'来避免此类异常。
521

被折叠的 条评论
为什么被折叠?



