Hibernate 调用无参存储过程
public static void callProcedure(String procedureName) throws Exception{
Session session = HibernateSessionFactory.getSession();
Transaction transaction = session.beginTransaction();
try{
Connection conn = session.connection();
CallableStatement callableStatement = conn.prepareCall("call " + procedureName + "();");
callableStatement.executeUpdate();
transaction.commit();
}catch(Exception e){
e.printStackTrace();
transaction.rollback();
throw e;
}finally{
HibernateSessionFactory.closeSession();
}
}















