Data truncation: Out of range value adjusted for column "***"

com.mysql.jdbc.MysqlDataTruncation: Data truncation: Out of range value adjusted for column '***' at row 1
    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:2548)
    at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1605)
    at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1524)

出现这个问题的原因有以下几种:
1.超过字段的表示范围。
2.设置了无符号的字段,却传了负数。

Jerky Lu wechat
欢迎加入微信公众号