You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Guido García Bernardo <gg...@tid.es> on 2006/12/18 17:37:47 UTC

How to get a ResultSet using the resultClass attribute

Hello,

I would like to call an Oracle stored procedure that returns a REF
CURSOR for a given query, this way:

<procedure id="proc_cursor" parameterMap="query_map"
resultClass="java.sql.ResultSet">
    { ? = call web_utils.get_cursor( #query# ) }
</procedure>

I am having some problems with the resultClass, it seems like it doesn't
work...
Is it possible to use it with a ResultSet?   How could I retrieve a
ResultSet without changing the parameterMap?

Thank you very much,
Guido.

Re: How to get a ResultSet using the resultClass attribute

Posted by Clinton Begin <cl...@gmail.com>.
Hi Guido...

Even if you use  { ? = call web_utils.get_cursor( #query# ) }, the ? is a
parameter.

Therefore, you need to declare an output parameter in your parameter class.
You can't return a resultset the way you would like to.  If I recall
correctly, this is the way JDBC works and iBATIS just follows suit.

Cheers,
Clinton

On 12/18/06, Guido García Bernardo <gg...@tid.es> wrote:
>
> Hello,
>
> I would like to call an Oracle stored procedure that returns a REF
> CURSOR for a given query, this way:
>
> <procedure id="proc_cursor" parameterMap="query_map"
> resultClass="java.sql.ResultSet">
>     { ? = call web_utils.get_cursor( #query# ) }
> </procedure>
>
> I am having some problems with the resultClass, it seems like it doesn't
> work...
> Is it possible to use it with a ResultSet?   How could I retrieve a
> ResultSet without changing the parameterMap?
>
> Thank you very much,
> Guido.
>