Announcement Announcement Module
No announcement yet.
generic code to call any stored procedure and processing large dataset Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • generic code to call any stored procedure and processing large dataset


    I need to write a generic code which can call any stored procedure and process result set of any size, basically I will be reading the result set and flusing the data out to a stream.

    I was able to call any stored procedure using SimpleJdbcCall and using the MapSqlParameterSource, so that the data type of the parameters can be detected automatically using meta data.

    The issue is with that the data I am getting back is a List of Maps, but the result set can be huge, I need to have access to the resultset directly or any other way in which I won't be having the entire List of Maps in memory but flushing the records to a stream as soon as the resultset is moved to next record.

    Thanks for the help


  • #2
    Hmm it would have been good if RowCallbackHandler could be used with SimpleJdbcCall. Is there any other way I can achieve calling any procedure and make use of meta data automatically as in SimpleJdbcCall, and have access to ResultSet or some call back ?


    • #3
      Just had a look at StoredProcedureItemReader from Spring Batch, it allows streaming of resultset, but here the issue will be with use of meta data for parameters (procedure column meta data) automatically as can be done with SimpleJdbcCall

      So basically I want the procedure column meta data feature of SpringJdbcCall (which it does implicitly)
      streaming of result set feature of StoredProcedureItemReader