@Override
public boolean ValidateUserInfo(UserInfo u) {

// TODO Auto-generated method stub
String hql = "from UserInfo u where u.userNo = ? and u.userPwd = ?";
Query query = sessionFactory.getCurrentSession().createQuery(hql);
query.setString(0, u.getUserNo());
query.setString(1, u.getUserPwd());
return query.executeUpdate()> 0;

}
报错:
严重: Servlet.service() for servlet [springMVC] in context with path [/sim] threw exception [Request processing failed; nested exception is org.hibernate.hql.internal.QueryExecutionRequestException: Not supported for select queries [from cn.com.bean.UserInfo as u where u.userNo = ?and u.userPwd = ?]] with root cause
org.hibernate.hql.internal.QueryExecutionRequestException: Not supported for select queries [from cn.com.bean.UserInfo as u where u.userNo = ?and u.userPwd = ?]