日期:2014-05-17 浏览次数:20960 次
ApplicationContext ctx = new FileSystemXmlApplicationContext("XXXXX.xml");
EmpService abccc = (EmpService)ctx.getBean("empService");
System.out.println(abccc.validLogin("123","123"));
int result = empService.validLogin(getUserName(), getPassWord());
java.lang.reflect.InvocationTargetException sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:597)
log.debug("finding MgrTable instance by Name And Passworld");
try {
String queryString = "from MgrTable as model where model.empName"+
"= ? and model.empPass= ?";
Query queryObject = getSession().createQuery(queryString);
queryObject.setParameter(0, name);
queryObject.setParameter(1, passWorld);
if (queryObject.list().size()>0) {
return (MgrTable)queryObject.list().get(0);
}else {
return null;
}
} catch (RuntimeException re) {
log.error("find by Name And Passworld failed", re);
throw re;
}