Caused by: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Truncated incorrect DOUBLE value: 'y'
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3513)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3447)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1951)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2101)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2554)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1761)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2046)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1964)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1949)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:477)
at org.hibernate.engine.query.NativeSQLQueryPlan.performExecuteUpdate(NativeSQLQueryPlan.java:165)
---------------------------------------------
原因分析:update tablename t set t.fieldname1 = xxx and t.fieldname2 where .....
set多个字段,要用逗号','隔开而非and.
细节注定成败!!!
本文深入分析了MySQL中数据类型错误导致的更新问题,详细解释了使用逗号而非AND来设置多个字段的重要性,强调了细节在编程实践中的关键作用。
550

被折叠的 条评论
为什么被折叠?



