(我使用的是Struts+spring+hibernate)
我的程序在运行中出现这样的问题,但是我看代码应该问题的.
org.springframework.jdbc.BadSqlGrammarException: Hibernate operation: could not execute query; bad SQL grammar [select userinfo0_.id as id, userinfo0_.username as username0_, userinfo0_.password as password0_ from info__userinfo userinfo0_ where userinfo0_.username=?]; nested exception is java.sql.SQLException: Base table or view not found, message from server: "Table 'info.info__userinfo' doesn't exist"
这样的问题搞我烦了几天啦!高手们指点一二吧!最后的DAO是代码片段:
代码
public Userinfo find(String username) {
List l = this.getHibernateTemplate().find("from Userinfo where username=?", username);
if (l == null || l.isEmpty()) {
return null;
}
else {
return (User) l.get(0);
}
}
我的程序在运行中出现这样的问题,但是我看代码应该问题的.
org.springframework.jdbc.BadSqlGrammarException: Hibernate operation: could not execute query; bad SQL grammar [select userinfo0_.id as id, userinfo0_.username as username0_, userinfo0_.password as password0_ from info__userinfo userinfo0_ where userinfo0_.username=?]; nested exception is java.sql.SQLException: Base table or view not found, message from server: "Table 'info.info__userinfo' doesn't exist"
这样的问题搞我烦了几天啦!高手们指点一二吧!最后的DAO是代码片段:
代码
public Userinfo find(String username) {
List l = this.getHibernateTemplate().find("from Userinfo where username=?", username);
if (l == null || l.isEmpty()) {
return null;
}
else {
return (User) l.get(0);
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货