换了个数据库,从oracle换为sql server2005,出现错误
Java code:
hql = "from Position p where p.tpId= '"+postId+"'";
很简单的一个hql语句都会报错,只是换了一下数据库,报如下错误:
Java code:
18:46:32,562 ERROR JDBCExceptionReporter:72 - 关键字 'where' 附近有语法错误。
org.springframework.orm.hibernate3.HibernateJdbcException: JDBC exception on Hibernate data access; nested exception is org.hibernate.exception.SQLGrammarException: could not execute query
Caused by: org.hibernate.exception.SQLGrammarException: could not execute query
遇到过这类情况的朋友请回答下哈,谢谢了。
同时祝大家新春快乐!
刚刚查询所有,即便 hql语句没有后面的where限制条件仍然出现同样的错误。
有一个地方是这样写的
Java code:
public PageModel selectAll(final HibernateTemplate hibernateTemplate,final int pageNo, final int pageSize,final String hql, final String hqlCount){
PageModel pageModel = null;
List itemList = new ArrayList();
try {
itemList = hibernateTemplate.executeFind(new HibernateCallback(){
public Object doInHibernate(Session session) throws Hib
相关问答:
执行的顺序:
1)文件浏览框(选择文件使用)
选择好文件后
点击一个导入按钮的时候 ,把上面上传框里的csv文件以一个ID为文件名,上传到**/**文件夹下
2)读取这个文件夹下的csv的文件,转换成sql
3 ......
安装了Oracle 10g,默认安装了orcl数据库,这个数据库能不能删除啊,还有我如果新建了其他数据库,怎么知道在web中登陆不同数据库的地址啊?
1
可以删除
2
在WEB地址栏中输入地址的时候指定新创建的数据库的IP ......
我一个项目,有个插入操作,具体是这样的:
我有进货信息表。在出货时选择相应的进货信息,输入数量,选择部门后,点保存按钮,由于网络延时,点一下没有反映,于是用户就又点一下,导致一次插入了两条记录:
例:
......
现在有两张表:文章主表A(articleId,articleTitle),文章评论表B(commentId,articleId,commentTitle)
现在我想实现这样的功能:列出文章列表,其中每篇文章标题下面列出此文章的前2个文章评论,请问sql语句怎么写啊 ......