有一个oracle存储过程:
test_owner.pkg_xyz.daycalculation(p_parameter =>" Tuesday");
My Simple JDBCCall调用Oracle过程:
public class StoredExecuter {
*fields*
public void ExecuteDailyProced (String dayId) {
try {
String slqPackage = "pkg_xyz";
String procName = "daycalculation";
SimpleJdbcCall jdbcCall = new SimpleJdbcCall(jdbcTemplate)
.withSchemaName("test_owner")
.withCatalogName(sqlPackage)
.withProcedureName(procName)
.declaredParameters(new SqlParameter(dayId,OracleTypes.Varchar));
jdbcCall.setAccessCallParameterMetaData(false);
jdbcCall.execute();
}
catch(Exception e) {
throw new RunTimeException("Cannot perform procedure due to : " +e.getMessage(),e);
}
}
}
例外:
java.lang.RuntimeException: Cannot perform procedure due to : 0
as tests.StoredExecuter.ExecuteDailyProced......
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
at org.springframework.jdbc.core.metadata.CallMetaDataContext.matchInParameterValuesWithCallParameters(CallMetaDataContext.java:577)
at org.springframework.jdbc.core.simple.AbstractJdbcCall.matchInParameterValuesWithCallParameters(AbstractJdbcCall.java:442)
at org.springframework.jdbc.core.simple.AbstractJdbcCall.doExecute(AbstractJdbcCall.java:376)
at org.springframework.jdbc.core.simple.SimpleJdbcCall.execute(SimpleJdbcCall.java:188)
感谢您解决此问题的任何帮助! 谢谢