У меня есть хранимая процедура в базе данных Oracle. Его подпись
Код: Выделить всё
CREATE OR REPLACE PROCEDURE PRC_GET_USERS_BY_SECTION
(user_cursor OUT Pkg_Types.cursor_type
, section_option_in IN Varchar2
, section_in IN Varchar2) AS ....
Код: Выделить всё
TYPE cursor_type IS REF CURSOR;
Код: Выделить всё
private class MyStoredProcedure extends StoredProcedure
{
public MyStoredProcedure(JdbcTemplate argJdbcTemplate)
{
super(argJdbcTemplate, "PRC_GET_USERS_BY_SECTION");
declareParameter(new SqlOutParameter("output", OracleTypes.CURSOR));
declareParameter(new SqlParameter("input1", Types.VARCHAR));
declareParameter(new SqlParameter("input2", Types.VARCHAR));
compile();
}
public Map execute() {
Map inParams = new HashMap();
inParams.put("input1", "BG");
inParams.put("input2", "FE");
Map output = execute(inParams);
return output;
}
}
Код: Выделить всё
public List getUserListFromProcedure() throws BatchManagerException
{
MyStoredProcedure sp = new MyStoredProcedure( this.jdbcTemplate );
Map result = new HashMap();
try
{
result = sp.execute();
}
catch( DataAccessException dae)
{
}
System.out.println(result.size());
return null;
}
Подробнее здесь: https://stackoverflow.com/questions/215 ... ways-empty