日期:2014-05-17 浏览次数:21036 次
public boolean isHasSysUser()throws NoSuchUserException{
Session session = null;
//HttpSession session=ServletActionContext.getRequest().getSession();
try{
session = Hibernate_Utils.getSession();
session.createSQLQuery("select t.id from T_MENU t where t.id=1").executeUpdate();
System.out.println("=====第二步:用户已经存在");
return true;
}catch(Exception e){
System.out.println("=====第二步:用户不存在");
throw new NoSuchUserException();
}finally{
session.close();
}
}