PDA

View Full Version : Calling Stored Procedure in iBatis with Spring



dowchen
Sep 16th, 2004, 10:36 PM
I cannot find any method in the SqlMapClientTemplate that can call the stored procedure defined in the iBatis?

Is there anyone have idea on this?

Dave :oops:

vscarpenter
Sep 24th, 2004, 03:48 PM
The iBATIS documentation is a little sketchy when it comes to dealing with Stored procs. But I am able to execute stored proc via. SQLMaps. Create your sqlMap xml file and setup your proc like this:

<procedure id="getAccounts" resultMap="accounts" parameterClass="com.j2eegeek.ibatistutorial.domain.AccountID">
{call dbname.procname(#acctID#}
</procedure>

The input can be a parameterClass or just a Map.


<parameterMap id="getAccountsCall" class="map">
<parameter property="acctID" jdbcType="INT" javaType="java.lang.Integer" mode="IN"/>
</parameterMap>

Email me directly and I can give you more info. hope this helps.

--Vinny
http://www.j2eegeek.com/blog/