小编Bha*_*tam的帖子

org.hibernate.exception.SQLGrammarException:无法使用滚动执行查询

我有以下查询,当我尝试使用 hibernate 执行它时,出现以下异常:

org.hibernate.exception.SQLGrammarException: 无法使用滚动执行查询。

在我的代码中,我滚动了 FORWARD_ONLY。任何人都可以提供一个完美的解决方案。

select * from (SELECT account_no    AS accountno,rownum r  FROM  sc_dcm_postpaid_index  WHERE  groupid = 'SBG-2012'  
and concat(trim(TO_CHAR(bill_date,'MONTH')),concat('-',TO_CHAR(bill_date,'YY')))='JUNE-12'  
AND ROWID  IN   (SELECT MAX(ROWID) AS row_no   ;   FROM sc_dcm_postpaid_index
WHERE groupid= 'SBG-2012'  and concat(trim(TO_CHAR(bill_date,'MONTH')),concat('-',TO_CHAR(bill_date,'YY')))='JUNE-12' 
GROUP BY account_no   HAVING COUNT (account_no) >= 1   ) ORDER BY account_no)where r >= 11  and  r <= 21..
Run Code Online (Sandbox Code Playgroud)

此外,当我将查询更改为

SELECT account_no    AS accountno,rownum r  FROM  sc_dcm_postpaid_index  WHERE  rownum >= 11  and  rownum <= 21 groupid = 'SBG-2012'  
and concat(trim(TO_CHAR(bill_date,'MONTH')),concat('-',TO_CHAR(bill_date,'YY')))='JUNE-12'  
AND ROWID …
Run Code Online (Sandbox Code Playgroud)

java hibernate scrollableresults

5
推荐指数
0
解决办法
2075
查看次数

标签 统计

hibernate ×1

java ×1

scrollableresults ×1