title: cannot receive out parameter from oracle procedure executed by mybatis
body: <p>I develop java application using Spring 3.0.5 and I work with database Oracle using mybatis-spring.</p>
  
  <p>I've an interface for mybatis:</p>
  
  <pre><code>public interface SubscriberMapper {
      Subscriber getSubscriberByMsisdn(String msisdn);
  
      void insertSubscriber(Subscriber subscriber);
  
      void updateSubscriber(Subscriber subscriber);
  
      void canCustomerSubscribe(@Param("msisdn") String msisdn, 
                           @Param("responseCode") Integer responseCode);
  </code></pre>
  
  <p>}</p>
  
  <p>mybatis xml content for canCustomerSubscribe:</p>
  
  <pre><code>&lt;parameterMap id="canCustomerSubscribeParams" type="map"&gt;
      &lt;parameter property="msisdn" jdbcType="VARCHAR" javaType="java.lang.String" mode="IN"/&gt;
      &lt;parameter property="responseCode" jdbcType="NUMERIC" javaType="java.lang.Integer" mode="OUT"/&gt;
  &lt;/parameterMap&gt;
  &lt;select id="canCustomerSubscribe" parameterMap="canCustomerSubscribeParams" statementType="CALLABLE"&gt;
      CALL wallet.pkg_wallet_validation.can_customer_subscribe(#{msisdn}, #{responseCode})
  &lt;/select&gt;
  </code></pre>
  
  <p>and code to execute:</p>
  
  <pre><code>public void subscribe(String msisdn) throws InvalidArgumentException {
      Integer responseCode = 0;
      subscriberMapper.canCustomerSubscribe(msisdn, responseCode);
      System.out.println("msisdn: " + msisdn + ", responseCode: " + responseCode);
  }
  </code></pre>
  
  <p>When I execute "subscribe" method with invalid "msisdn", I do not receive real out value from procedure. Execution of this procedure in the database returns reponseValue = 1001, but in Java code I receive 0. I turned on debug logging to stout for mybatis and output is:</p>
  
  <pre>2011-10-19 10:32:46,732 DEBUG [main] (Slf4jImpl.java:28) ooo Connection Opened
  2011-10-19 10:32:46,909 DEBUG [main] (Slf4jImpl.java:28) ==>  Executing: CALL wallet.pkg_wallet_validation.can_customer_subscribe(?, ?) 
  2011-10-19 10:32:46,911 DEBUG [main] (Slf4jImpl.java:28) ==> Parameters: 509999999(String), 0(Integer)
  msisdn: 509999999, responseCode: 0
  </pre>
  
  <p>When I change in "subscribe" method responseCode = null, I receive and error:</p>
  
  <pre>org.springframework.jdbc.UncategorizedSQLException: Error setting null parameter.  Most JDBC drivers require that the JdbcType must be specified for all nullable parameters. Cause: java.sql.SQLException: Invalid column type
  ; uncategorized SQLException for SQL []; SQL state [null]; error code [17004]; Invalid column type; nested exception is java.sql.SQLException: Invalid column type
  </pre>