title: java - passing array in oracle stored procedure
body: <p>I have a Java app accessing an oracle stored procedure. The arguments to the stored procedure include an array type. I do it like the following...</p>
  
  <pre><code>con = this._getConnection();  
  Connection narrowdConn = (Connection)WSJdbcUtil.getNativeConnection( (WSJdbcConnection)con );  
  
  callable = con.prepareCall("{call MY_PKG.MY_PROCEDURE(?, ?)}");  
  
  
  ArrayDescriptor arrayDescriptor = ArrayDescriptor.createDescriptor("VARCHAR2_ARR", narrowdConn);  
  ARRAY arrayArg1 = new ARRAY(arrayDescriptor, con, docNames);  
  ARRAY arrayArg2 = new ARRAY(arrayDescriptor, con, docTypes);  
  
  callable.setArray(1, arrayArg1);  
  callable.setArray(2, arrayArg2);  
  
  callable.execute();  
  </code></pre>
  
  <p>Now, I am getting this Exception...</p>
  
  <pre><code>java.sql.SQLException: invalid name pattern: MY_PKG.VARCHAR2_ARR
  </code></pre>
  
  <p>VARCHAR2_ARR is a public TYPE, defined inside an Oracle Package like the following:</p>
  
  <p>TYPE VARCHAR2_ARR  IS TABLE OF VARCHAR2(50);  </p>
  
  <p>And used as such in my stored proc...</p>
  
  <pre><code>PROCEDURE MY_PROCEDURE  
      (V_ARR_ARG1  IN VARCHAR2_ARR,  
       V_ARR_ARG2  IN VARCHAR2_ARR)  
  </code></pre>