更新时间:2022-11-01 15:08:07
我将在这里猜测你正在使用MySQL :-)它将零日期用作特殊占位符 - 不幸的是,JDBC无法处理它们默认情况下
I'm going to take a wild guess here that you're using MySQL :-) It uses "zero dates" as special placeholder - unfortunatelly, JDBC can not handle them by default.
解决方案是将zeroDateTimeBehavior = convertToNull指定为MySQL连接的参数(在数据源URL或附加属性中),例如: p>
The solution is to specify "zeroDateTimeBehavior=convertToNull" as parameter to your MySQL connection (either in datasource URL or as an additional property), e.g.:
jdbc:mysql://localhost/myDatabase?zeroDateTimeBehavior=convertToNull
这将导致所有这些值被检索为NULL。
This will cause all such values to be retrieved as NULLs.
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
JDBC连接mysql,TOMCAT错误: Cannot convert value '0000-00-00 00:00:00' from column 10 to TIMESTAMP
mysql解决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