title: java.sql.SQLException: Invalid argument(s) in call: Use setNull for user-defined types and REF types
body: <p>I'm trying to call a Stored Procedure using Java.</p>
  
  <p>I've looked through similar errors and already tried copying the solutions and Still having errors.</p>
  
  <p>java.sql.SQLException: Invalid argument(s) in call: Use setNull(int parameterIndex, int sqlType, String typeName) for user-defined types and REF types</p>
  
  <pre><code>import java.sql*;
  
  public class FusionDBConnection {
  
  public static void main(String args[]) {
      System.out.println("RUN PROCESS START");
  
      try {
  
          Class.forName("oracle.jdbc.driver.OracleDriver");
  
          Connection dbConn = DriverManager.getConnection("jdbc:oracle:thin:@10.XX.XXX.XXX:1521:AAA1", "TEST", "TESTPASS");
  
          CallableStatement cst = dbConn.prepareCall("{call EDGF.FMW_SELECT_PACS_SEQ(?,?,?,?)}");
  
          cst.setString(1,"A");
          cst.setString(2, "B");
          cst.setString(3,"C");
          cst.setNull(4, java.sql.Types.REF);
          cst.registerOutParameter(4,Types.REF);
  
          ResultSet outData = (ResultSet)cst.getObject(4); 
  
          while (outData.next()) {
              System.out.println(outData.getString(4));
          }
          dbConn.close();
          System.out.println("RUN PROCESS END");
      } catch (Exception e) {
          e.printStackTrace();
      }
  
  }
  }
  </code></pre>
  
  <p>Stored Procedure</p>
  
  <pre><code>create or replace 
  PROCEDURE FMW_SELECT_PACS_SEQ 
  (
    IN_RECORDTYPE IN VARCHAR2  
  , IN_CODE IN VARCHAR2 
  , IN_GENERATIONNUMBER IN VARCHAR2 
  , PACSSEQRESULTS OUT SYS_REFCURSOR
  ) AS 
  SELECTPACSSEQ VARCHAR2(10000);
  BEGIN
  --SELECT PACS_SEQ
  SELECTPACSSEQ := 
  
  'SELECT RECORD_TYPE, CODE, GENERATION_NUMBER, STATUS, LAST_UPDATED_BY, LAST_UPDATE_DATE FROM EDGF.EDGF_PACS_SEQUENCES 
  WHERE RECORD_TYPE ='''||IN_RECORDTYPE||''' AND CODE = '''||IN_CODE||'''AND GENERATION_NUMBER ='''||IN_GENERATIONNUMBER||'''';
  OPEN PACSSEQRESULTS FOR SELECTPACSSEQ;
  
  END FMW_SELECT_PACS_SEQ;          
  </code></pre>