title: Calling Oracle stored procedures with MyBatis
body: <p>I am in the process of moving our database over to Oracle from SQL Server 2008 but cannot get MyBatis to work.</p>
  
  <p>Given the following example:</p>
  
  <p><strong>UserMapper.xml</strong> (example)</p>
  
  <pre><code>&lt;resultMap type="User" id="UserResult"&gt;
      &lt;id property="userId" column="userId"/&gt;
      &lt;result property="firstName" column="firstName"/&gt;
      &lt;result property="lastName" column="lastName"/&gt;
  &lt;/resultMap&gt;
  
  &lt;select id="getUsers" statementType="CALLABLE" resultMap="UserResult"&gt;
      {CALL GetUsers()}
  &lt;/select&gt;
  </code></pre>
  
  <p><strong>UserDAO.java</strong></p>
  
  <pre><code>public interface UserDAO {
      public List&lt;User&gt; getUsers();
  }
  </code></pre>
  
  <p><strong>SQL Server procedure</strong></p>
  
  <pre><code>CREATE PROCEDURE [dbo].[GetUsers]
  AS
  BEGIN
      SET NOCOUNT ON;
      SELECT userId, firstName, lastName
      FROM Users
  END
  </code></pre>
  
  <p>...works in SQL Server 2008. Can someone please explain to me how to call the Oracle procedure (that has the same name and columns as the SQL Server procedure above) from the UserMapper.xml and populate my User class with an Oracle cursor?</p>
  
  <p>This is what I tried:</p>
  
  <pre><code>&lt;resultMap type="User" id="UserResult"&gt;
      &lt;id property="userId" column="userId"/&gt;
      &lt;result property="firstName" column="firstName"/&gt;
      &lt;result property="lastName" column="lastName"/&gt;
  &lt;/resultMap&gt;
  
  &lt;select id="getUsers" statementType="CALLABLE" resultMap="UserResult"&gt;
      {CALL GetUsers(#{resultSet,mode=OUT,jdbcType=CURSOR,resultMap=UserResult})}
  &lt;/select&gt;
  </code></pre>
  
  <p>and I get this error:</p>
  
  <pre><code>Caused by: org.apache.ibatis.reflection.ReflectionException: 
  Could not set property 'resultSet' of 'class java.lang.Class'
  with value 'oracle.jdbc.driver.OracleResultSetImpl@476d05dc' 
  Cause: org.apache.ibatis.reflection.ReflectionException: 
  There is no setter for property named 'resultSet' in 'class java.lang.Class'
  </code></pre>