新手提问,一个SQL相关的小问题,困扰了一下午了...
出错代码锁定在
List list = dao.QueryObject("from Login l where l.username='" + user+ "' and l.password='" + pass + "'");
是一个hibernate下的用户登录模块,得到用户输入的user password,对比数据库,有的话就存入list
报错是
com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.login login0_ where login0_.username='' and login0_.password=''' at line 1
SQL语法错误,HQL和SQL这里有什么不同么