ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Butler" <jeffgbut...@gmail.com>
Subject Re: Stored Procedure with OUT parameter
Date Sun, 27 Aug 2006 18:03:19 GMT
This is a bit of strangeness with stored procedures and iBATIS.  There is no
result set involved, so the query* methods will return null.  You should get
the output parameter value in your original parameter object - the
CompanyPriceList.priceListKey.id field.

Jeff Butler


On 8/27/06, Torsten Michelmann <torsten.michelmann@gmx.de> wrote:
>
> Hi,
>
> I have a problem with iBatis 2.1.7 running against DB2 for AS400 and
> calling a stored procedure defined as stproc(IN, OUT).
>
> The code below is supposed to return me a CompanyPriceList instance where
> the priceListKey.id is set once the call returns. But actually I just get
> null (no stacktrace).
> Is there anything wrong with my syntax?
>
>   CompanyPricelist ret=
> (CompanyPricelist)getSqlMapClient().queryForObject(
> IConstants.GET_STANDARD_PRICELIST_FOR_COMPANY,cp);
>
>    <parameterMap id="pm_StandardPriceListForCompany"
> class="CompanyPricelist">
>        <parameter property="companyKey.companyNumber" jdbcType="CHAR"
> javaType="java.lang.String" mode="IN" />
>        <parameter property="priceListKey.id" jdbcType="CHAR" javaType="
> java.lang.String" mode="OUT" />
>    </parameterMap>
>
>    <procedure id="getStandardPriceListForCompany"
> parameterMap="pm_StandardPriceListForCompany">
>        <![CDATA[
>        {call sopgm.GETPRLI (?, ?)}
>        ]]>
>    </procedure>
>
>
> --
> Greetings
> Torsten
>
> Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
> Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
>

Mime
View raw message