from course c where c.courseid=6
解决方案 »
- 关于Action和分层起名问题,此贴已经发表多次,但尚未解决,请有开发经验的朋友进。
- struts2和spring整合问题(导入了struts-spring-plugin.jar)
- The annotation @Autowired is disallowed for this location
- springMVC与velocity实现一个简单的静态页面数据传送
- 分页
- struts 跳转问题
- 使用标签<bean:include>出错??
- 哪个大哥能说说你们都是用什么东西搭建J2EE平台和开发工具
- struts的vector,select问题
- java 把页面中的table导出为word文档
- servlet运行问题!!!
- 插入记录问题?
但是query.list();就不行.知道这是什么原因么...
\急..在线等....
注意你写的是HQL, 而不是SQL
所以Course是类名, 而不是表名
所以类名是大写,不是小写
改为Query qury=session.createQuery("from Course c where courseid=6");提示course is not mapped
说明course这个类在你的映射文件里没有配置其实你是大小写的问题HQL是对对象进行查询而非数据库中的表
改为Query qury=session.createQuery("from Course c where c.courseid=6");