日期:2014-05-17 浏览次数:20704 次
public void saveStudent(Student student){ try { transaction = (org.hibernate.Transaction)session.beginTransaction(); session.save(student); transaction.commit(); } catch (Exception e) { transaction.rollback(); }finally{ session.close(); } }