ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roger Voss <rog...@qwest.net>
Subject Re: Oracle iBatis documentation
Date Fri, 27 Feb 2009 06:45:47 GMT
The code to make the sp call was like so:
        GetLineCodeLov_InOut params = new GetLineCodeLov_InOut("");
        List<Map<String, Object>> results = sqlMapClient.queryForList(
                    "msol.pk_web_lov_ref_cursors.get_line_code_lov",
params);

Turns out the constructor for the params object sets the IN argument (first
arg) - and looks like an empty string is a valid input to this particular
call (probably returns all lines as opposed to results for just a specific
line).

For anything that is defined in the sql map as an OUT argument, you don't
have to pass anything in. Of course there is an INOUT argument mode as well
- in which case you would have to pass something in.

On Thu, Feb 26, 2009 at 9:49 PM, Bhaarat Sharma <bhaarat.s@gmail.com> wrote:

> great! thanks
>
> but just some follow up questions.
>
> so if i am calling this sp (which requires two parameters) is this the
> right way to call it?
>
>  paramMap.put("age", age1);
>
> List returnListArray = (List) getSqlMapClientTemplate().queryForList(
>               "mtms.pk_web_lov_ref_cursors.get_line_code_lov", paramMap);
>
> basically i am just trying to find out, when calling the sp, whether I need
> to pass one variable (which is 'in') or do i need to pass something as the
> second (which is 'out') as well?
>
>
> On Fri, Feb 27, 2009 at 12:38 AM, Roger Voss <rogerv@qwest.net> wrote:
>
>> How about this:
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "
>> http://ibatis.apache.org/dtd/sql-map-2.dtd">
>> <sqlMap namespace="msol.pk_web_lov_ref_cursors">
>>
>>   <typeAlias alias="GetLineCodeLov_params"
>> type="com.tideworks.msol.PkWebLovRefCursorsTest$GetLineCodeLov_InOut"/>
>>
>>   <parameterMap id="getGetLineCodeLov_params"
>> class="GetLineCodeLov_params">
>>     <parameter property="i_sort_by"            jdbcType="VARCHAR"
>> javaType="string"               mode="IN"/>
>>     <parameter property="o_line_code_lov"      jdbcType="ORACLECURSOR"
>>  javaType="java.sql.ResultSet"   mode="OUT"/>
>>   </parameterMap>
>>
>>   <procedure id="get_line_code_lov"
>> parameterMap="getGetLineCodeLov_params" resultClass="hashmap">
>>     <![CDATA[
>>       { call mtms.pk_web_lov_ref_cursors.get_line_code_lov(I_SORT_BY=>
>> ?,O_LINE_CODE_LOV=> ?) }
>>     ]]>
>>   </procedure>
>> </sqlMap>
>>
>>
>> On Thu, Feb 26, 2009 at 9:25 PM, Bhaarat Sharma <bhaarat.s@gmail.com>wrote:
>>
>>> Hi,
>>>
>>> We have been using iBatis with sql server but now we are moving to
>>> Oracle.  Our stored procs will be changed to oracle as well.  I was
>>> wondering if iBatis supports oracle stored proc cursors? because our stored
>>> procs will be returning multiple resultsets.
>>>
>>> Is there any documentation or examples of iBatis being used with oracle
>>> stored procs?
>>>
>>> Thanks!
>>>
>>
>>
>

Mime
View raw message