Announcement Announcement Module
No announcement yet.
setResultSetType not working Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • setResultSetType not working

    Hi All, I have a class that calls a Stored Procedure.

    It takes in a few params and has a return type of a REF CURSOR.

    I can make the call to the procedure work just fine, but when I try to call the last() method (which moves the cursor to the last row in the ResultSet) on the result set. I get the exception:

    Invalid operation for forward only resultset : last

    Now I know what this is saying, and the JavaDoc for the last() method even says that it will throw this Exception if the "Type" of the ResultSet is of type: TYPE_FORWARD_ONLY.

    But the issue is that just before I call the execute() method to call the stored procedure I call the Spring method:


    (which is the int value of 1000, just FYI)

    and then when I loop through the result set I call the getType() method, and I get 1003!!!!

    Why doesnt it work? Are there any pit falls that I need to look out for?

    One theory I have is the type of return type that the SP returns, (being a REF CURSOR), could this impact it?

    Thanks heaps!

  • #2
    Ok, well I figured out that the reason is beacuse when you call a SP in oracle, you cannot have a scrollable resultset returned. It just wont let you.

    I do not have a nice work around yet, it looks like a lot of people have this issue, and I think I may have to re-work alot of my code