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

来源:互联网 发布:数码宝贝网络侦探智力 编辑:程序博客网 时间:2024/05/16 06:51

提示的原因是“ xxx  ”double型不是正确的,错误的原因在于把数据库

update user  set username='xxx',password='yyy' where id='zzz'

错写成

update user  set username='xxx' and password='yyy' where id='zzz'

将分隔符,错写为and

如果是用ssm框架的话,正确的写法应该是:

<update id="updateUser" parameterType="user">
        update sys_user
        <set >
            <if test="user_name!=null">
            user_name=#{user_name} ,
            </if>
            <if test="user_password!=null">
            user_password=#{user_password},
            </if>
        </set>
        where user_id=#{user_id}
    </update>



阅读全文
0 0
原创粉丝点击