java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Tim 异常解决办法
程序员文章站
2022-04-21 15:47:04
...
出现这个异常是由于数据库中关于 datetime 字段记录中出现了值为 0000-00-00 00:00:00 的一条记录,解决方法:删掉此条记录,或者更改为有效数据
Caused by: java.sql.SQLException: Value '0000-00-00 00:00:00'
can not be represented as java.sql.Timestamp
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:957)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:896)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:885)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:860)
at com.mysql.jdbc.ResultSetImpl.getTimestampFromString(ResultSetImpl.java:5705)
at com.mysql.jdbc.ResultSetImpl.getStringInternal
(ResultSetImpl.java:5338)
at com.mysql.jdbc.ResultSetImpl.getString(ResultSetImpl.java:5167)
at com.mysql.jdbc.ResultSetImpl.getString(ResultSetImpl.java:5206)
at com.alibaba.druid.filter.FilterChainImpl.resultSet_getString
(FilterChainImpl.java:907)
at com.alibaba.druid.filter.stat.StatFilter.resultSet_getString
(StatFilter.java:949)
at com.alibaba.druid.filter.FilterChainImpl.resultSet_getString(FilterChainImpl.java:905)
at com.alibaba.druid.proxy.jdbc.ResultSetProxyImpl.getString(ResultSetProxyImpl.java:693)
at com.alibaba.druid.pool.DruidPooledResultSet.getString(DruidPooledResultSet.java:257)
at org.apache.ibatis.type.StringTypeHandler.getNullableResult(StringTypeHandler.java:37)
at org.apache.ibatis.type.StringTypeHandler.getNullableResult(StringTypeHandler.java:26)
推荐阅读
-
解决:java.sql.SQLException:Value ‘0000-00-00‘ can not be represented as java.sql.Date
-
java.sql.SQLException: Value ‘0000-00-00 00:00:00‘ can not be represented as java.sql.Timestamp异常
-
FAQ(60):java.sql.SQLException: Value '0000-00-00' can not be represented as java.sql.Date
-
java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Tim 异常解决办法
-
mysql错误:Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp;的解决方法
-
FAQ(64):java.sql.SQLException: Value '0000-00-00' can not be represented as java.sql.Date
-
java.sql.SQLException: Value '0000-00-00' can not be represented as java.sql.Date(已解决)
-
java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp at
-
java.sql.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