I have a stored procedure that has an Array as an Input parameter.

Just wanted to know how to set the same from Java using Callable Statement.


I have declared a Type as follows in the Package Spec of the Stored Procedure.

TYPE CONTENTGUID_ARRTYPE IS TABLE OF VARCHAR2(3);

And I am using this variable in my java code below :

ArrayDescriptor contentGuidDescriptor = (ArrayDescriptor)
ArrayDescriptor.createDescriptor("CONTENTGUID_ARRTYPE", connection);
ARRAY contentGuid = new ARRAY (contentGuidDescriptor, connection, contentGuidString);

callableStmt = connection.prepareCall("{call Csp_Cat_Search_Pkg.Performsearch(?,?,?,?,?,?,?,?,?,?,?)}");

callableStmt.setArray(1, contentGuid);
callableStmt.setString(2, docId);
callableStmt.setString(3, title);
callableStmt.setString(4, status);
callableStmt.setString(5, fromDate);
callableStmt.setString(6, toDate);
callableStmt.setString(7, channel);
callableStmt.setString(8, market);
callableStmt.setString(9, role);
callableStmt.registerOutParameter(10, java.sql.Types.ARRAY);
callableStmt.registerOutParameter(11, java.sql.Types.VARCHAR);

But I get an Exception saying

java.sql.SQLException: Fail to construct descriptor: Unable to resolve type: "SYSTEM.CONTENTGUID_ARRTYPE"