You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Tokajac <im...@hotmail.com> on 2008/09/25 22:37:42 UTC
iBatis Stored Procedure call
Hello!
How can i call stored procedure with OUT parameters return values?
I tried with:
<procedure id="SPSSUSRSTS" parameterMap="paramsSPSSUSRSTS"
resultMap="getStatusResult">
{call SPSSUSRSTS(?,?,?)}
</procedure>
<parameterMap id="paramsSPSSUSRSTS" class="map" >
<parameter property="CSPRF" jdbcType="VARCHAR" javaType="java.lang.String"
mode="INOUT"/>
<parameter property="CSSTS5" jdbcType="VARCHAR"
javaType="java.lang.String" mode="INOUT"/>
<parameter property="CSMAIL" jdbcType="VARCHAR"
javaType="java.lang.String"mode="OUT"/>
</parameterMap>
<resultMap id="getStatusResult" class="UserForm">
<result property="username" jdbcType="CHAR" column="CSPRF" />
<result property="status" jdbcType="CHAR" column="CSSTS5" />
<result property="email" jdbcType="CHAR" column="CSMAIL" />
</resultMap>
Map<String, String> parameterMap = new HashMap<String, String>();
parameterMap.put("CSPRF",httpServletRequest.getUserPrincipal().getName() );
parameterMap.put("CSSTS5","0" );
UserForm uf = UserDao.getSts(parameterMap);
logger.info("Status: " + uf.getStatus());
Parameters seems to be passed OK, but database remains to hang on ResultSet
log row.
I found plenty of examples around, but i haven't been able to create working
solution so far: I need tested code
Regards
--
View this message in context: http://www.nabble.com/iBatis-Stored-Procedure-call-tp19677828p19677828.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.