老师,问题求解
<insert id="addUser" parameterType="com.zucc.zjh.entity.User">
insert into user(username,password,status,gender,email,tel,`desc`)
value(#{userName},#{password},#{status},#{sex},#{email},#{tel},#{desc})
</insert>
public String getPassowrd(String userName) {
System.out.println(userName);
DBAccess dbAccess = new DBAccess();
SqlSession sqlSession = null;
String password = null;
try {
sqlSession = dbAccess.getSqlSession();
IUser ui = sqlSession.getMapper(IUser.class);
password = ui.getPassword(userName);
System.out.println(password);
//sqlSession.commit();
}
catch(IOException e) {
e.printStackTrace();
}
return password;
}
老师,我这样显示是提交成功了,但是数据库中并没有插入
这是为什么啊,我那个commit()没有注释掉也一样