`

mysql bug【Cannot convert value '0000-00-00 00:00:00'】

阅读更多

java.sql.SQLException: Cannot convert value '0000-00-00 00:00:00' from column 20
 to TIMESTAMP

 

bug记录在此

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","");

 

 

mysql驱动连接串的一些说明见:

http://dev.mysql.com/doc/refman/5.0/en/connector-j-reference-configuration-properties.html

 

里面有很多可以挖掘出来的连接参数

 

在此记录下 方便后来人

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics