public List search() {
// TODO Auto-generated method stub
List list=null;
Session session=null;
String hql="from Order";
try{
session=super.getSessionFactory().openSession();
Query query=session.createQuery(hql);
list=query.list();
}catch(Exception e){
e.printStackTrace();
}finally{
session.close();
}
return list;
}
我这个类是继承了spring中的HibernateDaoSupport,在struct中的action里调用这个方法报下面这个错org.hibernate.exception.GenericJDBCException: could not execute query
Caused by: java.sql.SQLException: 关键字 'Order' 附近有语法错误。
// TODO Auto-generated method stub
List list=null;
Session session=null;
String hql="from Order";
try{
session=super.getSessionFactory().openSession();
Query query=session.createQuery(hql);
list=query.list();
}catch(Exception e){
e.printStackTrace();
}finally{
session.close();
}
return list;
}
我这个类是继承了spring中的HibernateDaoSupport,在struct中的action里调用这个方法报下面这个错org.hibernate.exception.GenericJDBCException: could not execute query
Caused by: java.sql.SQLException: 关键字 'Order' 附近有语法错误。
解决方案 »
- spring opensessioninviewIntercepter
- 新手在线求教SSH框架(struts2.1 spring3.0 hibernate3.3)搭建问题
- 第一次用hibernate报错
- 请问service层中怎么拿到httpSession?
- 使用sruts与hibernate上传图片保存到数据库中
- 如何用java创建一个类似于window的资源管理器。急!急!急!
- 请问:在spring MVC 从没有form的jsp页浏览后台的数据, 如果需要带参数(应该到server层吧?),如何做啊
- 如何监控端口进出的数据?
- 开启tomcat后,键入http://localhost:8080 后出现一个验证对话框,怎么办?
- 我的tomcat服务器,为什么tomcat/classes里的文件都说找不到?
- 关于分页的典型问题。
- Myeclipse打不开struts-config.xml
could not execute query
Caused by: java.sql.SQLException: 关键字 'Order' 附近有语法错误。
明显的不能执行查询语句的错误呀 order 排序附近有错 你把sql 复制出来 在数据库里试试