ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kris Schneider <kschnei...@gmail.com>
Subject Re: Problems with registering OUT parameter in Oracle stored procedure
Date Wed, 22 Dec 2004 19:06:16 GMT
This seems to be working for me:

<sqlMap>

    <parameterMap id="noInputsSingleResult" class="map">
        <parameter property="resultCode"
                   jdbcType="NUMERIC"
                   mode="OUT"/>
        <parameter property="result"
                   jdbcType="ORACLECURSOR"
                   mode="OUT"
                   typeHandler="com.dotech.ibatis.ResultSetToResultHandler"/>
    </parameterMap>

    <procedure id="proc1" parameterMap="noInputsSingleResult">
        <![CDATA[
            {?= call proc1(?)}
        ]]>
    </procedure>

    <procedure id="proc2" parameterMap="noInputsSingleResult">
        <![CDATA[
            {?= call proc2(?)}
        ]]>
    </procedure>

</sqlMap>

I've implemented a custom TypeHandlerCallback that converts the
ResultSet into a javax.servlet.jsp.jstl.sql.Result, but that's just a
detail of what I need to do with it...

On Wed, 22 Dec 2004 08:28:55 -0700, Clinton Begin
<clinton.begin@gmail.com> wrote:
> Ref cursors are not supported.  They can be implemented with a custom
> type handler, but not for an output parameter.  Try using
> jdbcType="OBJECT" and javaType="java.lang.Object".
> 
> Clinton
> 
> On Tue, 21 Dec 2004 16:36:19 -0000, Dooley, Liam
> <Liam.Dooley@agriculture.gov.ie> wrote:
> > Hi,
> >
> > Has anyone successfully executed an Oracle stored procedure that returns a result
set with multiple columns using ibatis?
> > We have a stored procedure that returns a result set which contains data for populating
a custom object. This result set is returned as a REFCURSOR and so needs to be registered
as an OUT parameter of type oracle.jdbc.driver.OracleTypes.CURSOR by ibatis?, but it's not
clear to me how to achieve this.
> > Does anybody know if ibatis can handle this scenario and if so how would i implement
it?
> >
> > This is the current configuration which gives the following error ("--- Check the
output parameters (register output parameters failed).
> > --- Cause: java.sql.SQLException: Invalid column type"):
> >
> >   <parameterMap id="customerDetailsByIdParams" class="map">
> >         <parameter property="applicantDetails" javaType="ApplicantDetails" mode="OUT"/>
> >         <parameter property="foNumber" jdbcType="NUMERIC" javaType="long" mode="IN"/>
> >         <parameter property="roleType" jdbcType="VARCHAR" javaType="java.lang.String"
mode="IN"/>
> >   </parameterMap>
> >
> >   <procedure id="getCustomerDetailsById" resultMap="customerDetailsByIdResult"
parameterMap="customerDetailsByIdParams">
> >                 { CALL ? := PKCO_01_BCUS_DETAILS_GET.bcus_details_get(?,?) }
> >   </procedure>

-- 
Kris Schneider <mailto:kschneider@gmail.com>

Mime
View raw message