Try:

*public* List <CallDataDetail> selectCDDRpt()
{
  return getSqlMapClientTemplate().queryForList("TEST_TESTPROC.GET_CDDRPT");
}

You're returning a list of rows, no extra work is required.  Use the Hashmap
if you need to pass values INTO the stored procedure.

-Ryan

On Mon, Mar 10, 2008 at 1:43 PM, Jesse Reimann <[EMAIL PROTECTED]>
wrote:

>  I've successfully been able to use iBATIS to retrieve and map data from
> an Oracle ref cursor using the examples posted on the Wiki. I do have a
> questions about queryForList(string) method.
>
>
>
> I can retrieve my List successfully if my dao code looks like this:
>
>
>
>     *public* List <CallDataDetail> selectCDDRpt()
>
>     {
>
>       Map myMap = *new* HashMap();
>
>
>
>       getSqlMapClientTemplate().queryForList("TEST_TESTPROC.GET_CDDRPT"
> ,myMap);
>
>       *return* (List <CallDataDetail>)myMap.get("rs1");
>
>
>
>     }
>
>
>
> However if I try to get the List this way it returns a List with 10
> elements which are all NULL:
>
>
>
>     *public* List <CallDataDetail> selectCDDRpt()
>
>     {
>
>       *return* getSqlMapClientTemplate().queryForList(
> "TEST_TESTPROC.GET_CDDRPT");
>
>
>
>     }
>
>
>
> My parameter map and procedure call looks as follows:
>
>
>
>     <parameterMap id="single-rs" class="map" >
>
>         <parameter property="rs1" javaType="java.sql.ResultSet" 
> jdbcType="ORACLECURSOR"
> mode="OUT" resultMap="CallDataDetailResult"/>
>
>     </parameterMap>
>
>     <procedure id="GET_CDDRPT" parameterMap="single-rs" >
>
>          { ? = call RPTS_PCK.GET_CDDRPT }
>
>     </procedure>
>
>
>
>
>
> Can anyone shed some light on why this is? Is there are way I can change
> my parameter settings to have queryForList return a List directly when
> calling a ref cursor?
>
>
>
> Thanks,
>
>
>
> Jesse Reimann
>

Reply via email to