异常-Data truncation: Truncated incorrect DOUBLE value: '-9370.3530-'

1 Details exception log

9/11/04 17:36:09 ERROR base.SQLHelper: Data truncation: Truncated incorrect DOUBLE value: '-9370.3530-'
com.mysql.jdbc.MysqlDataTruncation: Data truncation: Truncated incorrect DOUBLE value: '-9370.3530-'
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3971)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3909)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2527)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2680)
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2490)
        at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1858)
        at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2079)
        at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2013)
        at com.mysql.jdbc.PreparedStatement.executeLargeUpdate(PreparedStatement.java:5104)
        at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1998)
        at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:105)
        at 

  

2 checked online discussion and possibilities

 

  A database encoding Thus, the coding utf8 into utf8mb4.
  B upgrade mysql driver 
  C jdbc connection configuration, to turn useUnicode = true, and to set the encoding of a Chinese support, it does not necessarily coincide with the coding mysql table, just support Chinese on the line. CharacterEncoding = utf8 e.g.
   D mybatis the problem, we need
mybtais is the emergence of a select statement when the insert into a strange question, the generated SQL statement, the implementation of MYSQL customer service side is no problem, but there has been use of mybatis framework: Cause: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Truncated incorrect DOUBLE value: 'N900' error online for a long time to find a final solution, the problem occurs because there is where the condition select, mode field type is varchat, use the following ways mybatis mapper file where mode = 1, where mode change = '1', problem solving, specific reasons to be studied. 
 
I am not above case 
 
3 Finally, by virtue of which the sql string type with '(single quotation marks) to solve the problem, pay attention to the stitching sql, perhaps executed directly in the database is no problem, but there will be problems code execution
  例如 update table set phone = '1511001010100' where name = 'xxxysdfdsf'
 
 
 
 

Guess you like

Origin www.cnblogs.com/QuestionsZhang/p/11802278.html