代码如下
@Test
public void updateUser(){
SqlSession sqlSession = MybatisUtils.getSqlSession();
UserMapper mapper = sqlSession.getMapper(UserMapper.class);
int res=mapper.updateUser(new User(4,"jay","112233"));
if (res>0) System.out.println("修改成功");
//提交事务
sqlSession.commit();
sqlSession.close();
}
Idea中看到的
sqlyog中看到的,可以看到id=4这里已经改了,但是Idea里面没改