存储过程工作正常。我已经在 SQL Navigator 中对其进行了测试,并且每次都运行良好。
这是我得到的异常堆栈:
org.springframework.jdbc.UncategorizedSQLException: CallableStatementCallback; SQL [{call PKG_RPT_STE_DATA.GETCOREREPORTEXTRAS(?, ?, ?, ?, ?, ?, ?)}] 的未分类 SQLException;SQL 状态 [null]; 错误代码[0];光标关闭。嵌套异常是 java.sql.SQLException: Cursor is closed。org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83) org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate. java:969) org.springframework.jdbc.core.JdbcTemplate.call(JdbcTemplate.java:1003) org.springframework.jdbc.core.simple.AbstractJdbcCall.executeCallInternal(AbstractJdbcCall.java:391) org.springframework.jdbc。
这是我的 Java 代码(使用 Spring 3.0.5)
private class GetStandardReportExtrasSPV2{
int nAreaLevel;
int nAssignment;
int nUserRole;
int nAcisNum = 0;
String strAreaMenu;
String strLDO = null;
private SimpleJdbcCall procGetReportExtras;
public GetStandardReportExtrasSPV2(DataSource ds, int nUserRole, String strAreaMenu,
int nAssignment, int nAreaLevel, String strLDO, int nAcisNum) {
JdbcTemplate jdbcTemplate = new JdbcTemplate(ds);
jdbcTemplate.setResultsMapCaseInsensitive(true);
this.procGetReportExtras =
new SimpleJdbcCall(jdbcTemplate)
.withCatalogName("PKG_RPT_STE_DATA")
.withProcedureName("GetCoreReportExtras")
.returningResultSet("CURREPORTLIST",
ParameterizedBeanPropertyRowMapper.newInstance(Report.class));
}
public List<Report> getReportsList() {
HashMap<String, Object> params = new HashMap<String, Object>();
params.put("PNASSIGNMENT", new Integer(nAssignment));
params.put("PNUSERROLE", new Integer(nUserRole));
params.put("PSAREAMENU", strAreaMenu);
params.put("PNAREALEVEL", new Integer(nAreaLevel));
params.put("PSLDO", strLDO);
params.put("PNACISNUMBER", new Integer(nAcisNum));
if (nAcisNum > 0)
params.put(ACIS_NUMBER, nAcisNum);
SqlParameterSource in = new MapSqlParameterSource().addValues(params);
Map m = procGetReportExtras.execute(in);
return (List) m.get("CURREPORTLIST");
}
}
这是 Oracle 存储过程:
PROCEDURE GetCoreReportExtras
( pnAssignment IN NUMBER,
pnUserRole in NUMBER,
psAreaMenu in VARCHAR2,
pnAreaLevel in NUMBER,
curReportList OUT outcur,
psLDO in VARCHAR2 default 'none',
pnAcisNumber in NUMBER default 0) IS
BEGIN
--start working through roles...
IF substr(psAreaMenu,1,1) <> '7' and pnAssignment > 74999 --CAM Area of some sort
THEN
-- these users never get an HBDC or QBR...
--NOTHING WILL BE RETURNED
open curReportList for
SELECT FILE_NAME, NULL AS DISPLAY_TEXT
FROM CORE_REPORT_NAME
WHERE STATIC_REPORT_TYPE = 'XXXXXXXX';
ELSE -- Non-CAM, Non-GPO...Check traditional Sales first...
IF substr(psAreaMenu,1,1) = '7' THEN --Sales Assignment of some sort
-- retrieve the HBDC File Name for these sales users...
open curReportList for
SELECT FILE_NAME, 'Anemia Worksheet Link' AS DISPLAY_TEXT
FROM CORE_REPORT_NAME
WHERE STATIC_REPORT_TYPE = 'HBDCANEMIA'
UNION
SELECT FILE_NAME, 'HBDC Bone Metabolism Worksheet Link' AS DISPLAY_TEXT
FROM CORE_REPORT_NAME
WHERE STATIC_REPORT_TYPE = 'HBDC_BONE';
-- sales-perspective users don't see a QBR...
--NOTHING IS RETURNED FOR QBR
ELSE -- Callpoint or Top-SDO Assignment
IF pnUserRole = 11 THEN --TOP SDO
-- These users don't see HBDC...
--NOTHING IS RETURNED FOR HBDC
-- but they do get the QBR...
open curReportList for
SELECT FILE_NAME, 'CIDO Report Selection' AS DISPLAY_TEXT
FROM CORE_REPORT_NAME
WHERE STATIC_REPORT_TYPE = 'QBR'
and SHORT_NAME = psAreaMenu;
--ELSE -- Some form of Callpoint
-- these perspectives don't get QBR or HBDC
--NOTHING WILL BE RETURNED
END IF;
END IF;
END IF;
END GetCoreReportExtras;
关于我为什么会遇到该异常的任何提示?