Posts

Showing posts from July, 2014

MyBatis calling Oracle stored procedures

Lesson learned today: Use MyBatis update statement for calling Oracle stored procedures with input and output parameters. Fragment of my MyBatis mapper xml file before: <select id="getPasswordVerificationStatus" statementType="CALLABLE" parameterType="getPasswordVerificationStatus"> {call WEB.IFC_CORE.GETUSERPASSWORDSTATUS( #{idEmp,mode=IN}, #{login,mode=IN}, #{password,mode=IN}, #{expiry,jdbcType=INTEGER,mode=OUT}, #{expiryCode,jdbcType=INTEGER,mode=OUT})} </select> I've tried to implement a stored procedure call (using Oracle jdbc driver and Oracle Universal Connection Pool in background), taking an inspiration from some working examples . According the Ibatis / myBatis migration guide we can use select, update or insert when calling stored procedure . Since my procedure only asked for a status and didn't insert or modify any data I expected a select element to be the appropriate one to use. Caused b