Results 1 to 2 of 2

Thread: RowMapper and Oracle Cursor expression

  1. #1
    Join Date
    Nov 2008
    Posts
    1

    Default 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 at 04:36 AM.

  2. #2
    Join Date
    Dec 2006
    Posts
    1,061

    Default

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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •