爱问知识人 爱问教育 医院库

在SSH中hibernate报错(在线等待)

首页

在SSH中hibernate报错(在线等待)

这个类发生异常:$Proxy0这个方法发生了异常:login方法参数[0]:entity.Excep ():usersisnotmapped[fromuserswherename=?andpassword=?]org.hibernate.hql.ast.QuerySyntax [fromuserswherename=?andpassword=?]主要报错去上DAO中login方法publicUserslogin(Usersusers)throwsSQLException,DataAccessException,HibernateException{//TODOAuto-generatedmethodstubSystem.out.println("DAo连接前");Queryquery=this.getSession().createQuery("fromuserswherename=?andpassword=?");query.setString(0,users.getName());query.setString(1,users.getPassword());Objectobj=query.uniqueResult();System.out.println("DAo连接后");if(obj!=null){return(Users)obj;}returnnull;}

提交回答
好评回答

其他答案

    2010-11-16 20:59:01
  • "from users where name=? and password=?"
    users是表名吗,没有写错?
    

    G***

    2010-11-16 20:59:01

类似问题

换一换
  • 其他编程语言 相关知识

  • 电脑网络技术
  • 电脑网络

相关推荐

正在加载...
最新问答 推荐信息 热门专题 热点推荐
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200

热点检索

  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 171-190
返回
顶部
帮助 意见
反馈

确定举报此问题

举报原因(必选):