Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/65.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Mysql更新用户密码_Java_Mysql_Jdbc_Mybatis - Fatal编程技术网

Java Mysql更新用户密码

Java Mysql更新用户密码,java,mysql,jdbc,mybatis,Java,Mysql,Jdbc,Mybatis,我正在尝试使用mybatis更新数据库密码: update person set name = #{name}, address = #{address}, phoneNumber = #{phoneNumber}, balance = #{balance}, password = #{password}, id = #{new_id} where id = #{id} 但是,出现以下异常: org.ap

我正在尝试使用mybatis更新数据库密码:

update person 
   set name = #{name}, 
       address = #{address}, 
       phoneNumber = #{phoneNumber},
       balance = #{balance}, 
       password = #{password}, 
       id = #{new_id} 
 where id = #{id}
但是,出现以下异常:

org.apache.ibatis.exceptions.PersistenceException: 
### Error updating database.  Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column 'id' cannot be null
### The error may involve com.lsp.mybatis.PersonMapper.update-Inline
### The error occurred while setting parameters
### SQL: update person set name = ?, address = ?, phoneNumber = ?             ,balance = ?, password = ?, id = ? where id = ?
### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column 'id' cannot be null
我已指定要更新的用户id。为什么说“id不能为空”


有人能告诉我我做错了什么吗?

在查询中删除:
id={new\u id}

因此,查询将是:

update person 
   set name = #{name}, 
       address = #{address}, 
       phoneNumber = #{phoneNumber},
       balance = #{balance}, 
       password = #{password}
 where id = #{id}

您想更新
ID
还是
密码