I am using spring jdbc template, to create record using stored procedure
public Long create(City $obj) {
SimpleJdbcCall jdbcCall = new SimpleJdbcCall(getJdbcTemplate().getDataSource()).withProcedureName(SP_ADD_UPDATE);
jdbcCall.declareParameters(new SqlOutParameter(ConstantUtil.RETUR_VAL, OracleTypes.BIGINT));
Map<String, Object> jdbcCallResult = jdbcCall.execute(new MapSqlParameterSource(populateParams($obj)));
return (Long) jdbcCallResult.get(ConstantUtil.RETUR_VAL);
}
params
private static Map<String, Object> populateParams(City $obj) {
Map<String, Object> _params = new HashMap<String, Object>();
_params.put("CITYID", $obj.getCityId());
_params.put("CITYNAME", $obj.getCityName());
_params.put("USERID", $obj.getCurUser());
return _params;
}
How can we batch update using simpleJdbcCall while using stored procedure ?