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: Calling a function with Integer param and return type an inline params
Date Sat, 24 May 2008 12:04:25 GMT
There's no result set here, so queryForObject won't work.  Try this in your
DAO:

Map parms = new HashMap();
parms.put("stateId", new Integer(1));
update("getState", parms);
Integer stateId = (Integer) parms.get("result");

Jeff Butler



On Sat, May 24, 2008 at 4:01 AM, mfs <farhan.sarwar@gmail.com> wrote:

>
> Guys,
>
> I am trying to call an oracle function (using inline parameters) and it
> just
> doesnt seem to work and returns null (though the same has been tested from
> a
> standalone plsql client returns the result as expected)..
>
> Can anyone suggest as to what the problem is in the code below, the oracle
> function takes a number argument and returns a number,
>
> DAO class
> -----
> Integer stateId = (Integer)queryForObject("getState", new Integer(1));
> System.out.println(stateId);
>
> mapping.xml
> ------
>  <procedure id="getState" >
>         { #result,javaType=java.lang.Integer,jdbcType=NUMERIC# = call
>
> location.get_state(#stateId,javaType=java.lang.Integer,jdbcType=NUMERIC,mode=IN#)
> }
>  </procedure>
>
> Thanks in advance
>
> --
> View this message in context:
> http://www.nabble.com/Calling-a-function-with-Integer-param-and-return-type-an-inline-params-tp17445906p17445906.html
> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>
>

Mime
View raw message