MySQL

MySQL的timestamp类型,在java中对应的java.sql.timestamp,使用时候,使用

Timestamp create_time = new Timestamp(0);

  而后插入mysql数据库时,会提示出错。要求timestamp的参数得是大于0的。

相关的页面 http://bugs.mysql.com/bug.php?id=27930

Connector/J 3.0 didn't care about truncation on writes. C/J 3.1 and newer do. The JDBC specification requires drivers to throw exceptions for truncations on writes.

If you don't care about truncations (why not?), then add "jdbcCompliantTruncation=false" to your JDBC URL.

posted on 2015-02-25 23:37  majia1949  阅读(118)  评论(0编辑  收藏  举报

导航