Java Mysql更新用户密码
我正在尝试使用mybatis更新数据库密码: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
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
还是密码
?