这是我试图调用的 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);
这是我的Java代码:
private class GetStandardReportExtrasSPV2{
int nAreaLevel;
int nAssignment;
int nUserRole;
int nAcisNum = 0;
String strAreaMenu;
String strLDO = null;
private SimpleJdbcTemplate simpleJdbcTemplate;
private SimpleJdbcCall procGetReportExtras;
public GetStandardReportExtrasSPV2(DataSource ds, int nUserRole, String strAreaMenu,
int nAssignment, int nAreaLevel, String strLDO, int nAcisNum) {
this.simpleJdbcTemplate = new SimpleJdbcTemplate(ds);
JdbcTemplate jdbcTemplate = new JdbcTemplate(ds);
jdbcTemplate.setResultsMapCaseInsensitive(true);
this.procGetReportExtras =
new SimpleJdbcCall(jdbcTemplate)
.withCatalogName("package")
.withProcedureName("proc")
.returningResultSet(REPORT_LIST,
ParameterizedBeanPropertyRowMapper.newInstance(Report.class));
}
public List<Report> getReportsList() {
Map<String, Object> params = new HashMap<String, Object>();
params.put(USER_ASSIGNMENT, nAssignment);
params.put(USER_ROLE, nUserRole);
params.put(AREA_MENU, strAreaMenu);
params.put(AREA_LEVEL, nAreaLevel);
params.put(SEGMENT, strLDO);
params.put(ACIS_NUMBER, nAcisNum);
SqlParameterSource in = new MapSqlParameterSource()
.addValues(params);
Map m = procGetReportExtras.execute(new HashMap<String, Object>(0), in);
return (List) m.get(REPORT_LIST);
}
}
当 getReportsList() 调用 execute() 时,我得到以下异常:
java.lang.ArrayIndexOutOfBoundsException: 2 org.springframework.jdbc.core.metadata.CallMetaDataContext.matchInParameterValuesWithCallParameters(CallMetaDataContext.java:555) org.springframework.jdbc.core.simple.AbstractJdbcCall.matchInParameterValuesWithCallParameters(AbstractJdbcCall.java:419) org.springframework .jdbc.core.simple.AbstractJdbcCall.doExecute(AbstractJdbcCall.java:364) org.springframework.jdbc.core.simple.SimpleJdbcCall.execute(SimpleJdbcCall.java:173)
关于我做错了什么的任何提示?