在使用mybatis框架的时候,出现了这个问题,
这个问题其实很简单,就是你在映射文件中写错了sql语句,你写的可能是这样情况
:
select id,username,birthday,sex,address from user where id = ${id}
在mybatis中,这个${id}是不正确的应该是#{id},所以正确的应该是:
select id,username,birthday,sex,address from user where id = #{id}
在使用mybatis框架的时候,出现了这个问题,
这个问题其实很简单,就是你在映射文件中写错了sql语句,你写的可能是这样情况
:
select id,username,birthday,sex,address from user where id = ${id}
在mybatis中,这个${id}是不正确的应该是#{id},所以正确的应该是:
select id,username,birthday,sex,address from user where id = #{id}