简体   繁体   中英

Error:com.mysql.jdbc.MysqlDataTruncation: Data truncation: Truncated incorrect DOUBLE value: by Delete

I have this code:

bb.doCammand("delete  from models where model_id='" + del + "' OR model_name='" + del + "'");

I received this error:

Error:com.mysql.jdbc.MysqlDataTruncation: Data truncation: Truncated incorrect DOUBLE value: xd model_id and model_name are string.

How can I solve it?

Seems like a kind of typo in your query.

Assuming that del is a variable of String try to change the query regarding to this showcase:

"DELETE from models WHERE model_id =" + del + " OR model_name =" + del

It's better to avoid a concatenation at the end of the query.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM