I am relatively new to hibernate and am having some trouble calling an unmapped Oracle stored procedure. The sp creates a CLOB and sets it to out parameter, which is the sys_refcursor. Where it gets confusing for me is when I try to convert the returned object into a CLOB.
The three possible ways that I see to execute the query are list(), scroll() and iterate(). scroll() seems like the most appropriate option as it returns a ScrollableResults object which has the getClob(int) method.
ScrollableResults sr = q.scroll() creates a ScrollableResults object that is not null, but any attempt to convert to a clob throws a null pointer exception. I'm pretty sure my query returns a valid result, but don't know if im accessing it correctly (sr.getClob(0)).
Any recommendations or comments will be appreciated
Why I am answering your question after the insult on my name.
But you can't return a Clob in a stored procedure through Hibernate, you can only return an actual reference cursor, and it must be the first parameter. You can always use straight JDBC or the SQLQuery object.