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

来源:互联网 发布:大富豪棋牌免费源码 编辑:程序博客网 时间:2024/06/05 03:44

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>
阅读全文
0 0
原创粉丝点击