ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From C.Ze...@ads.it
Subject Re: Stored procedures (package functions) returning a row
Date Tue, 03 Oct 2006 15:50:55 GMT


C.Zecca@ads.it scritti il 03/10/2006 15:26:03

> "Jeff Butler" <jeffgbutler@gmail.com> scritti il 03/10/2006 14:59:55
>
> > There are two different issues here.
>
> [...]
>
> > 2. Only use queryForObject if the function returns a result set.  If
> > it is just returning a single value, then call it with syntax like
this:
> >
> > {? = call myFunction}
> >
> > Register an output parameter - not a resultMap - then call it with
> > the "update" method.

[...]

The Developer guide reports, about update() that

   These methods are specifically meant for update statements (a.k.a.
   non-query).
   That said, it’s not impossible to execute an update statement using one
   of the query methods below,
   however this is an odd semantic and obviously driver dependent.

Its signature

   public int update(String statementName, Object parameterObject)
   throws SQLException

clearly indicates that is NOT possible to get any "row" via return value.
The only way might be via the Object parameterObject.

> I hope that it's possible to get, via output parameters, not only
> simple SQL types but record types (rows) as well.

There are some topics and related post about output parameters in the
mailing list
and calls of the form

{ ? = call functionName }

This one
http://www.mail-archive.com/user-java@ibatis.apache.org/msg00998.html
reports uses of the queryForObject (I guess that a result set is handled
via a Map)
not of the update method()

Furthermore, the definition fo the result is mapped onto a simple SQL type

<parameterMap id="getStringParameterMap" class="java.util.Map">
        <parameter property="result" jdbcType="VARCHAR"
javaType="java.lang.String" mode="OUT" />
Mime
View raw message