// TODO Auto-generated method stub
try
{
HashMap hm= new HashMap();
//在这里的map参数要与xml配置文件参数名一致,不支持VARCHAR2的类型
hm.put("pa", a);
hm.put("pb", b);
hm.put("pc", "");
this.getSqlMapClientTemplate().update("testProc", hm);
return Long.valueOf(hm.get("pc").toString());
}catch(Exception e)
{
System.out.println(e.getMessage());
return Long.valueOf(-1);
}
}
<parameter property="pa" jdbcType="NUMBER" javaType="java.lang.Integer" mode="IN"/>
<parameter property="pb" jdbcType="NUMBER" javaType="java.lang.Integer" mode="IN"/>
<parameter property="pc" jdbcType="VARCHAR" javaType="java.lang.String" mode="OUT"/>
</parameterMap>
<procedure id="testProc" parameterMap="ProcParameters" >
{call P_testProc(?,?,?)}
</procedure>
--存储过程
is
begin
pc:=pa+pb;
end;