Announcement Announcement Module
Collapse
No announcement yet.
dealing with large resultsets Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • dealing with large resultsets

    Hi,

    I've got potentially large resultsets to deal with (1000+ records, 10+ columns per record) in my jdbcdaosupport class. How can i make sure spring doesn't build up a temporary collection in memory (ie disconnected resultset) ?

    I am using the jdbcdaosupport class with sqlrowset ie
    Code:
    getJdbcTemplate().queryForRowSet(query);
    but this caches the rowset before handing it back to the caller. Any chance of getting around this ?

    Thanks,
    Jorg

  • #2
    How are you looking to get around this? By processing each row as its read from the result set? If that's the case you would use a JdbcTemplate method that took a RowMapper, ResultSetExtractor or a RowCallbackHandler.

    Comment


    • #3
      Well it seems that something like a RowCallbackHandler is my only option yes.

      Comment


      • #4
        Use the callback approach. That way nothing is saved in RAM during iteration over the result set and there is no Spring-imposed limit on the number of rows that can be handled.

        Comment

        Working...
        X