zoukankan      html  css  js  c++  java
  • Error updating database. Cause: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Truncated incorrect DOUBLE value: 'as3'

    执行更新时的出错信息

    Whitelabel Error Page

    This application has no explicit mapping for /error, so you are seeing this as a fallback.

    Fri Jun 29 15:02:45 CST 2018
    There was an unexpected error (type=Internal Server Error, status=500).
    ### Error updating database. Cause: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Truncated incorrect DOUBLE value: 'as4' ### The error may involve com.nenu.dao.EmployeeDao.Employee ### The error occurred while setting parameters ### SQL: update employee set emp_name = ? and emp_password = ? where id=? ### Cause: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Truncated incorrect DOUBLE value: 'as4' ; ]; Data truncation: Truncated incorrect DOUBLE value: 'as4'; nested exception is com.mysql.jdbc.MysqlDataTruncation: Data truncation: Truncated incorrect DOUBLE value: 'as4'

    更新代码

    <update id="updateEmployee" parameterMap="Employee">
            update
            employee
            set
            emp_name = #{emp_name}
            and emp_password = #{emp_password}        
            where 
            id=#{id}
        </update>

    错误原因及更正方法

    update 更新时,连接两个变量的不是and ,而是 ,

    更正代码

    <update id="updateEmployee" parameterMap="Employee">
            update
            employee
            set
            emp_name = #{emp_name} ,emp_password = #{emp_password}        
            where 
            id=#{id}
        </update>

    编译通过

  • 相关阅读:
    HashMap的理解
    红黑树
    No constructor found matching
    会话 控制终端 setsid
    信息表示和处理 from computer system chapter 2
    tcp keepalive
    TCP 四步挥手
    CS 课程
    close vs shutdown socket
    Linux time总结
  • 原文地址:https://www.cnblogs.com/lick468/p/9243554.html
Copyright © 2011-2022 走看看