title: Calling Oracle Stored Procedure throws Caused by: java.sql.SQLException: Invalid column type: 1111
body: <p>I am calling this Oracle Stored Procedure using Spring SimpleJdbcCall<br>
  The code is throwing <strong><em>"Caused by: java.sql.SQLException: Invalid column type: 1111"</em></strong></p>
  
  <pre><code>        org.springframework.jdbc.UncategorizedSQLException: CallableStatementCallback; 
          uncategorized SQLException for SQL [{call O_XEROX_PRNT_PRT(?, ?)}]; SQL state [99999]; error code [17004]; Invalid column type: 1111; 
          nested exception is java.sql.SQLException: Invalid column type: 1111
  </code></pre>
  
  <p>Here is the stored Procedure, I tried to simplify it as much as I can for testing. so Its doing nothing but randomizing some values and returning random message,   </p>
  
  <p>The Stored Procedure is executing fine from SqlDeveloper...</p>
  
  <pre><code>CREATE OR REPLACE PROCEDURE O_XEROX_PRNT_PRT 
  (
  CLIENT_KEY          IN VARCHAR2
  ,P_STATUS           IN VARCHAR2
  
  -- OUTPUT back to java
  , O_STATUS          OUT BOOLEAN
  , O_MESSAGE         OUT VARCHAR2
  
  ) AS 
      PROC_STATUS         BOOLEAN;
      PROC_ERROR_MESSAGE  VARCHAR2(4000);
  
      rand_num number;
  BEGIN
  
      dbms_output.put_line('O_XEROX_PRNT_PRT ');
      select round(dbms_random.value(1,10)) into rand_num     from dual;   
  
      IF rand_num &gt; 8 THEN
              PROC_STATUS  := TRUE;
              PROC_ERROR_MESSAGE := 'ALL IS GOOD';
      ELSE
              PROC_STATUS  := FALSE;
              PROC_ERROR_MESSAGE := 'SOMTHING WENT WRONG!!! ';
      END IF;
  
  
  END O_XEROX_PRNT_PRT;
  </code></pre>
  
  <p>Java code I am using:</p>
  
  <pre><code>     String CLIENT_KEY          = 'CLIENT_KEY val';
              String P_STATUS         = 'Printer works';
  
              Boolean O_STATUS =true;
              String O_MESSAGE ;
  
              JdbcTemplate template = new JdbcTemplate(printerHubPortalDS);
  
              SimpleJdbcCall jdbcCall = new SimpleJdbcCall(template).withProcedureName("O_XEROX_PRNT_PRT")
                      .declareParameters(
                              new SqlParameter(CONST_CLIENT_KEY, Types.VARCHAR),
                              new SqlParameter(CONST_P_STATUS , Types.VARCHAR),                           
                              );
  
              MapSqlParameterSource paramMap = new MapSqlParameterSource()
                      .addValue(CONST_CLIENT_KEY,CLIENT_KEY)
                      .addValue(CONST_P_STATUS ,P_STATUS );
  
              //This line is throwing the error
              Map&lt;String, Object&gt; resultMap = jdbcCall.execute(paramMap);
  
              String tmp =  (String)resultMap.get(CONST_O_STATUS);
              O_STATUS = Boolean.valueOf(tmp);
              O_MESSAGE = (String) resultMap.get(CONST_O_MESSAGE);
  </code></pre>