mybatis不会自动提交事务,因此在进行增删改操作之后,需要手动提交事务:sqlSession.commit();
插入操作:
1.在StudentDao.java中增加方法定义:
public int insertStudent(Student student);
2.在mapper中写sql语句(StudentDao.xml中):
<!--插入操作-->
<insert id="insertStudent"
mybatis不会自动提交事务,因此在进行增删改操作之后,需要手动提交事务:sqlSession.commit();
插入操作:
1.在StudentDao.java中增加方法定义:
public int insertStudent(Student student);
2.在mapper中写sql语句(StudentDao.xml中):
<!--插入操作-->
<insert id="insertStudent"