We call the pl / sql stored procedure through Spring SimpleJdbcCall, the fetchsize set on the JdbcTemplate is ignored by SimpleJdbcCall. The sample size of the rowmapper template results is 10, although we set the fetchsize for jdbctemplate to 200. Any idea why this is happening and how to fix it?
Printed fetchsize from the result set into a line string in the code snippet below. When it's 200, and at another time it's 10, although I use the same JdbcTemplate in both cases.
This direct execution via jdbctemplate returns fetchsize of 200 in mapperper lines
jdbcTemplate = new JdbcTemplate(ds);
jdbcTemplate.setResultsMapCaseInsensitive(true);
jdbcTemplate.setFetchSize(200);
List temp = jdbcTemplate.query("select 1 from dual", new ParameterizedRowMapper() {
public Object mapRow(ResultSet resultSet, int i) throws SQLException {
System.out.println("Direct template : " + resultSet.getFetchSize());
return new String(resultSet.getString(1));
}
});
This execution via SimpleJdbcCall always returns fetchsize from 10 in rowmapper
jdbcCall = new SimpleJdbcCall(jdbcTemplate).withSchemaName(schemaName)
.withCatalogName(catalogName).withProcedureName(functionName);
jdbcCall.returningResultSet((String) outItValues.next(), new ParameterizedRowMapper<Map<String, Object>>() {
public Map<String, Object> mapRow(ResultSet rs, int row) throws SQLException {
System.out.println("Through simplejdbccall " + rs.getFetchSize());
return extractRS(rs, row);
}
});
outputList = (List<Map<String, Object>>) jdbcCall.executeObject(List.class, inParam);