Problem with ibatis in / out parameter

Can anyone tell me what happened? I have two procedures and two mappings for them. One works fine and the other fails. This works great:

    <parameterMap id="mapping-descriptions" class="java.util.Map">
        <parameter property="id" javaType="java.lang.Long" jdbcType="NUMBER" mode="IN"/>
        <parameter property="lang" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="shortDesc" javaType="java.lang.String" jdbcType="VARCHAR" mode="OUT"/>
        <parameter property="fullDesc" javaType="java.lang.String" jdbcType="VARCHAR" mode="OUT"/>
    </parameterMap>
<procedure id="get-description"
        parameterMap="mapping-descriptions">
        {call COM_DESCRIPTION_PKG.get_desc(?,?,?,?)}
</procedure>

      

And it fails:

    <parameterMap id="mapping-description-modifiable" class="java.util.Map">
        <parameter property="id" javaType="java.lang.Long" jdbcType="NUMBER" mode="INOUT"/>
        <parameter property="lang" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="shortDesc" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="fullDesc" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="modify" javaType="boolean" jdbcType="NUMBER" mode="IN"/>
    </parameterMap>
<procedure id="add-description"
        parameterMap="mapping-description-modifiable">
        {call COM_DESCRIPTION_PKG.add_desc(?,?,?,?,?)}
</procedure>

      

with this exception:

--- The error occurred while executing update procedure.  
--- Check the {call COM_DESCRIPTION_PKG.add_desc(?,?,?,?,?)}.  
--- Check the output parameters (register output parameters failed).  
--- Cause: java.sql.SQLException: Invalid column type: -99999999

      

I can't figure out what happened to the second procedure and / or its display. Could there be some problem with "INOUT"?

+2


source to share


2 answers


I tried to pass in the default but it didn't help




It works! Just changed the jdbcType of the id property to NUMERIC and it will work! Unfortunately I don't need this anymore. :)

+5


source


What value are you passing for the INOUT parameter? I assume you need to provide a default value for it.



0


source







All Articles