Announcement Announcement Module
Collapse
No announcement yet.
RowMapper and Oracle Cursor expression Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • RowMapper and Oracle Cursor expression

    Hi,

    is there an efficient way to implement a RowMapper to handle SQL queries like the following (returned as OUT parameters in a StoredProcedure)

    SELECT TABLE_NAME,
    CURSOR(SELECT COLUMN_NAME
    FROM USER_TAB_COLUMNS b
    WHERE a.TABLE_NAME = b.TABLE_NAME
    ) COLUMN_LIST
    FROM USER_TABLES a

    So far, I haven't found a way other than casting COLUMN_LIST (rs.getObject(2)) to a ResultSet and iterating using a hand-written loop.

    It would be far more intuitive if it could somehow be mapped using another RowMapper - maybe nested within the existing one.

    Also, if the hand-written loop is the only way to go, do I need to close the ResultSet in the end, or will it be done automatically when the RowMapper is destoyed ?

    Thanks in advance for the help

    Philip
    Last edited by mouratos; Nov 2nd, 2008, 05:36 AM.

  • #2
    Have you taken a look at JdbcCursorItemReader in spring batch? It might satisfy your requirement.

    Comment

    Working...
    X