У меня есть следующий код для вызова хранимой процедуры
Map<String, Object> t = defaultTemplate.call(connection -> {
CallableStatement callableStatement = connection.prepareCall("{call stored_proc(?, ?, ?, ?, ?)}");
callableStatement.setString(1, userId);
callableStatement.registerOutParameter(2, Types.VARCHAR);
callableStatement.setString(3, field2);
OracleConnection oracleConnection = connection.unwrap(OracleConnection.class);
Array array = oracleConnection.createOracleArray("T_ACCOUNT_TYPE", accountsList.toArray());
callableStatement.setArray(4, array);
callableStatement.setString(5, "N");
callableStatement.execute();
return callableStatement;
}, parameters);
и подпись хранимой процедуры ниже:
stored_proc(userId in varchar2, sid in out varchar2, field2 in varchar2, v_acct_list in t_account_type, v_keep_forever in char default 'N');
Когда я запускаю этот код, я получаю ошибку как показано ниже:
[ERROR] o.a.c.c.C.[.[.[.[dispatcherServlet] - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.jdbc.InvalidResultSetAccessException: CallableStatementCallback; invalid ResultSet access for SQL []; nested exception is java.sql.SQLException: Invalid column index] with root cause
java.sql.SQLException: Invalid column index
что я делаю не так?