|
|
|
error:
java.sql.SQLException: Cannot convert value '0000-00-00 00:00:00' from column 20 to TIMESTAMP.
solve:
连接数据库的url增加:zeroDateTimeBehavior=convertToNull 或 round
解决方案参考:
[url=http://dev.mysql.com/doc/refman/5.0/en/connector-j-reference-configuration-properties.html]http://dev.mysql.com/doc/refman/5.0/en/connector-j-reference-configuration-properties.html
[url=http://bugs.mysql.com/bug.php?id=18308]http://bugs.mysql.com/bug.php?id=18308
Maybe the problem is with connection string. It should include zeroDateTimeBehavior=convertToNull.
con=DriverManager.getConnection("jdbc:mysql://localhost/test?zeroDateTimeBehavior=convertToNull","root",""); |
|