出错代码://List vlist = this.getHibernateTemplate().find("from AndroidCustomer ct where ct.token = "+token);

正确代码:List vlist= this.getHibernateTemplate().find("from AndroidCustomer a where a.token= '" + token+"'");

这里的token为字符串,(当为字符串或者日期时候一定要有单引号,因为在数据库查询的时候也要用到单引号)

 

当为数字时候,可以不用单引号,因为PL/SQL中查询的时候及没有用到单引号,数字。千万注意

相关文章:

  • 2021-05-28
  • 2022-02-02
  • 2021-11-17
  • 2022-12-23
  • 2021-06-28
  • 2022-02-24
猜你喜欢
  • 2021-12-02
  • 2021-12-22
  • 2022-12-23
  • 2022-03-07
  • 2022-02-20
  • 2022-12-23
相关资源
相似解决方案