Announcement Announcement Module
Collapse
No announcement yet.
StoredProcedure and access to SqlWarnings Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • StoredProcedure and access to SqlWarnings

    We are calling an Oracle StoredProcedure via the Spring StoredProcedure class. This storedProcedure may return partial results and we need to be able to inform the client.

    What we want to do is to check the SQLWarnings that may be returned on the statement and tell the object that called the StoredProcdure that this specific warning happened. I can't see anywhere using StoredProcedure were I can create a callback other than a RowMapper. But this would mean that we would have to check for the warning on each row (could be upto 10,000).

    I also don't want to throw an Excpetion on a warning (using ignoreWarnings = false) as we want the result set.

    The solution we are considering is bypassing StoredProcedure and using jdbcTemplate and creating a CallableStatementCallback to pass into execute() on jdbcTemplate. We can then check the CallableStatment for warnings and update the calling object.

    Is this the best or only way to do it? I would rather continue to use the StoredProcedure class is possible.

    Thanks

    Paul
Working...
X