关于getHibernateTemplate().find()方法的问题
代码:List<Users>userlist=this.getHibernateTemplate().find("selectufromUsersuwhereu.user...
代码:List<Users> userlist = this.getHibernateTemplate().find(
"select u from Users u where u.username=? and password=?",
new Object[] { username , password });
数据库实例名是orcl。登录时报错,后台输出:
Hibernate: select users0_.USERID as USERID11_, users0_.USERNAME as USERNAME11_, users0_.PASSWORD as PASSWORD11_, users0_.NAME as NAME11_, users0_.REGISTERDATE as REGISTER5_11_, users0_.ZJLOGIN as ZJLOGIN11_ from orcl.USERS users0_ where users0_.USERNAME=? and users0_.PASSWORD=?
2010-05-10 21:12:02,593 ERROR [org.hibernate.util.JDBCExceptionReporter] - <ORA-00942: 表或视图不存在
为什么自动在表明前面加上orcl呢?在plsql中写sql,加上orcl的话也会提示“表或视图不存在”。这是什么问题呢?
实体类名和对应的表明都是Users 。我记得user是关键字,users不是关键字吧? 展开
"select u from Users u where u.username=? and password=?",
new Object[] { username , password });
数据库实例名是orcl。登录时报错,后台输出:
Hibernate: select users0_.USERID as USERID11_, users0_.USERNAME as USERNAME11_, users0_.PASSWORD as PASSWORD11_, users0_.NAME as NAME11_, users0_.REGISTERDATE as REGISTER5_11_, users0_.ZJLOGIN as ZJLOGIN11_ from orcl.USERS users0_ where users0_.USERNAME=? and users0_.PASSWORD=?
2010-05-10 21:12:02,593 ERROR [org.hibernate.util.JDBCExceptionReporter] - <ORA-00942: 表或视图不存在
为什么自动在表明前面加上orcl呢?在plsql中写sql,加上orcl的话也会提示“表或视图不存在”。这是什么问题呢?
实体类名和对应的表明都是Users 。我记得user是关键字,users不是关键字吧? 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询