org.springframework.jdbc.UncategorizedSQLException: StatementCallback; uncategorized SQLException for SQL [select * from ( select rownumber() over(order by 1) as rownumber_, row_.* from ( select * from (select
bill_id as "手机号码",
b.status_name as "客户状态",
user_type as "客户分类",
省略字段
ARPU_BADD as "ARPU档次",
PRODUCT_TYPE as "产品订购关系",
MHIGH_TYPE as "中高端状态",
'1-8-' || rtrim(char(value(a.management_id, 0))) || '-' ||
rtrim(char(value(a.region_id, 0))) || '-' AS AREA_CODE
from db2info.dw_user_mhigh_SPECIAL_201007 a
left join db2info.dim_user_status b
on a.user_status=b.status_id
left join db2info.dim_area_dept c
on a.region_id=c.region_id
left join db2info.dim_org_info d
on a.org_id=d.org_id
left join db2info.dim_plan e
on a.plan_id=e.plan_id
where a.status=1 and user_type ='不稳定客户' order by bill_id) t where AREA_CODE like '1-8-%' ) as row_ ) as temp_ where rownumber_ between 970001 and 980000]; SQL state [null]; error code [-99999]; [ibm][db2][jcc][10120][10898] 操作无效:已关闭 result set。; nested exception is com.ibm.db2.jcc.b.SqlException: [ibm][db2][jcc][10120][10898] 操作无效:已关闭 result set。
用spring,ibatis进行分页查询,连接DB2数据库,怪就怪在这些这个分页SQL的有的时候报这个错,偶尔出现这个问题。整个SQL是一个月执行一次,分页查询的,数据量相对比较大点,如上面的SQL,between 970001 and 980000,前面的执行都没问题,每次查询1万条。出现这个问题很诡异,也不知道如何进行查证。
开始考虑是不是DB2服务器缓存满了,丢弃了本次连接,导致JAVA查询取下一条结果集得不到。但是也不是很确定,希望哪位朋友帮忙指点指点。
------解决方案--------------------------------------------------------
看看日志,日志上应该有错误信息吧。
------解决方案--------------------------------------------------------
查看你的db2diaglog,那里估计有报错信息