I created a stored procedure which returns result rows and two output parameters.
I am unable to find any thing in spring from which i can get ResultSet
and outPutParameters
.
I want to achieve something like
this using Spring framework.
We use something like the following in our code
public Map<String, Object> findData() {
List prmtrsList = new ArrayList();
prmtrsList.add(new SqlParameter(Types.VARCHAR));
prmtrsList.add(new SqlParameter(Types.VARCHAR));
prmtrsList.add(new SqlOutParameter("result", Types.VARCHAR));
Map<String, Object> resultData = jdbcTemplate.call(connection -> {
CallableStatement callableStatement = connection.prepareCall("{call STORED_PROC(?, ?, ?)}");
callableStatement.setString(1, "first");
callableStatement.setString(2, "last");
callableStatement.registerOutParameter(3, Types.VARCHAR);
return callableStatement;
}, prmtrsList);
return resultData;
}