MyBatis 프로시저 호출, result Vo
Java
----------------------------------------------------------------
public void testProc(SqlSession session) throws SQLException {
ProcVo vo = new ProcVo();
vo.setParam1("11");
vo.setParam2("bb");
session.update("UserStatOld.testProc", vo);
System.out.println("resultCd : " + vo.getResultCd());
System.out.println("resultMsg : " + vo.getResultMsg());
}
Vo
----------------------------------------------------------------
public class ProcVo {
private String param1;
private String param2;
private String resultCd;
private String resultMsg;
// 이하 getter, setter 정의
}
XML
----------------------------------------------------------------
<update id="testProc" statementType="CALLABLE" parameterType="vo.ProcVo">
{call PR_TEST(
#{param1, mode=IN, jdbcType=VARCHAR}
, #{param2, mode=IN, jdbcType=VARCHAR}
, #{resultCd, mode=OUT, jdbcType=VARCHAR}
, #{resultMsg, mode=OUT, jdbcType=VARCHAR}
)}
</update>