当 JDBC 尝试将 MySQL (5.1.51) 中的有效日期时间转换为 java.sql.timestamp 时,将引发 java.sql.SQLException。一个例子是:
java.sql.SQLException: Cannot convert value '2012-04-05 10:20:00' from column 40 to TIMESTAMP
这是第一次
Versions:
MySQL: 5.1.51
J/Connector: 5.1.19
Column Definition: DATETIME
Java Type: java.sql.Timestamp
堆栈跟踪:
Cannot convert value '2012-04-05 10:20:00' from column 40 to TIMESTAMP.
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:982)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:927)
at com.mysql.jdbc.ResultSetRow.getTimestampFast(ResultSetRow.java:1335)
at com.mysql.jdbc.BufferRow.getTimestampFast(BufferRow.java:576)
at com.mysql.jdbc.ResultSetImpl.getTimestampInternal(ResultSetImpl.java:6466)
at com.mysql.jdbc.ResultSetImpl.getTimestamp(ResultSetImpl.java:6066)
at com.mysql.jdbc.ResultSetImpl.getTimestamp(ResultSetImpl.java:6104)
at org.apache.tomcat.dbcp.dbcp.DelegatingResultSet.getTimestamp(DelegatingResultSet.java:300)
at org.apache.tomcat.dbcp.dbcp.DelegatingResultSet.getTimestamp(DelegatingResultSet.java:300)
at org.apache.tomcat.dbcp.dbcp.DelegatingResultSet.getTimestamp(DelegatingResultSet.java:300)
DAO 类最近没有被修改过。服务器上最近的唯一变化是将 MySQL 从 5.1.46 升级到 5.1.51