title: Call PL/SQL function returning Oracle type from Java
body: <p>I have a PL/SQL function as follows which returns an Oracle type (PROCESSEXCLEFILEARGS)</p>
  
  <pre><code>FUNCTION PROCESS_FILE_INTERNAL
      (
        i_Filename VARCHAR2,
        i_EventType NUMBER
      ) 
      RETURN PROCESSEXCELFILEARGS
  </code></pre>
  
  <p>I have to call this function from Java and my Java Method looks as follows</p>
  
  <pre><code>OracleCallableStatement cstmt = null;
      try{  
          OracleDriver ora = new OracleDriver();
          DriverManager.registerDriver(ora);
  
          Connection connection = ora.defaultConnection();
          String call = "{ ? = call NEUTRINO_META.PKG_EXCEL.PROCESS_FILE_INTERNAL(?, ?) }";
                        cstmt = (OracleCallableStatement)connection.prepareCall(call);
                        cstmt.setQueryTimeout(1800);
                        cstmt.registerOutParameter(1, OracleTypes.OTHER, "NEUTRINO_META.PROCESSEXCELFILEARGS");
                        cstmt.setString(2, filename);
                        cstmt.setDouble(3, eventType);                          
                        cstmt.execute();
  
                        OracleObjects.ProcessExcelFileArgsobj = (OracleObjects.ProcessExcelFileArgs)cstmt.getObject(1);
                        connection.commit();
  
  
                  }
      catch (SQLException e){
          WriteEventToDb(e.getMessage());
      }
      finally{
          if (cstmt != null){
              cstmt.close();
          }
      }
  </code></pre>
  
  <p>OracleObject.ProcessExcelFileArgs is implementing SQLData, and the readSQl(..) and writeSQL(..) method are implemented properly to read and write the types fields.</p>
  
  <p>But when i run this java method I get a SQLException with message 'Invalid column type: 1111'</p>
  
  <p>Can anyone let me know if there is anything wrong in the approach I took, or if there is any other way to retrieve the return oracle type as a java object.</p>
  
  <p>EDIT:</p>
  
  <pre><code>create or replace 
  TYPE PROCESSEXCELFILEARGS FORCE AS OBJECT 
  ( 
    FullFilePath VARCHAR2(700),
    Filename VARCHAR2(200),
    Graph TYPEGRAPHDATA
  )
  </code></pre>
  
  <p>please not that TYPEGRAPHDATA is another user defined Oracle type at schema level</p>
  
  <p>thanks</p>