ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stevens, Ian" <IStev...@globeandmail.com>
Subject Implicit map/list for result set of stored procedure call?
Date Thu, 16 Jul 2009 19:09:39 GMT
I'm trying to grab data from an Oracle stored procedure using iBatis
2.3.4. I have something like the following in my XML:
     <resultMap id="result" class="hashmap">
         <result property="year" column="YEAR"/>
     <parameterMap id="params" class="map">
         <parameter property="po_rc" javaType="java.sql.ResultSet"
jdbcType="ORACLECURSOR" mode="OUT" resultMap="result"/>
         <parameter property="po_rec_cnt" javaType="java.lang.Long"
jdbcType="BIGINT" mode="OUT"/>
         <parameter property="po_currency_flag"
javaType="java.lang.Long" jdbcType="BIGINT" mode="OUT"/>
         <parameter property="pi_company_id" jdbcType="NUMBER"
javaType="java.lang.Long" mode="IN"/>
     <procedure id="getData" parameterMap="params">
         {call pkg.foo(?,?,?,?)}

There are a number of columns in the result set. Is it possible to have
the procedure implicitly populate a map with each row of the results? or
do I have to explicitly specify mappings for each column like I did with
YEAR above? I just need the values in the order they appear as columns.
Better still, can I have the result populated as a list of lists, one
list per row containing the values of the columns in order?

View raw message