标签:data ati 插入 col box serve exec mysql int
现象:能正常查询。但在插入datetime类型的字段报如下错误:
Caused by: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Incorrect datetime value: ‘‘ for column ‘crtTime‘ at row 1
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2868)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1573)
at com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1160)
at com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:685)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1400)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1314)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1299)
解决方法:将驱动由mysql-connector-java-5.0.3-bin.jar更新为mysql-connector-java-5.1.10-bin.jar 问题解决。
转载!!!!(所以说jar包还是要更新的。。。)
记录一次mysql时间插入错误(Data truncation: Incorrect datetime value)
标签:data ati 插入 col box serve exec mysql int
原文地址:https://www.cnblogs.com/donghongchao/p/9057105.html