您的位置:首页 > 数据库 > MySQL

Cause: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Truncated incorr

2017-08-23 11:48 459 查看

Cause: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Truncated incorrect

Cause: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Truncated incorrect DOUBLE value:


解决方法

在mybatis 的xml文件中制定数据库字段类型

原来的xml如下

<delete id="deleteByCustomerId" parameterType="java.lang.String">
delete from customer_manage
where customer_id =${customerId}
</delete>


修改为
#{}
(需要将mapper里用
@param
注解方式传入参数,并添加
jdbcType=VARCHAR


<delete id="deleteByCustomerId" parameterType="java.lang.String">
delete from customer_manage
where customer_id =#{customerId, jdbcType=VARCHAR}
</delete>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  数据库 mybatis
相关文章推荐