日期:2014-05-17 浏览次数:20944 次
String hql = "from House h where h.agent="+agent+" and h.name LIKE '%" + findUcBlur+ "%'";
String hql = "from House h where h.agent=? and h.name LIKE %?%";[
String hql = "from House h where h.agent=? and h.name LIKE '%" + findUcBlur
+ "%'";[
String hql = "from House h where h.agent=? and h.name like ?";
Query query = session.createQuery(hql);
query.setParameter(0, "xxxx");
query.setParameter(1, "%xxx%");
query.list();
"from User where username = ‘” + username + "' and password = '" + password + "'";如果用户在条件中添加了类似 or 1=1这样的,那么这条语句不管用户和密码是否填写正确都会成立都可以登陆成功。