File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Passing Array to Stored Procedure Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Passing Array to Stored Procedure" Watch "Passing Array to Stored Procedure" New topic
Author

Passing Array to Stored Procedure

Gilbert johnson
Ranch Hand

Joined: Jul 10, 2005
Posts: 45
Hi

I read the solution that AVI provided in the following topic:
http://www.coderanch.com/t/302345/JDBC/java/Passing-array-input-procedure-thin

But my error i still there.
I will try to provide you all the information. If you could help me, I would really appreciate it.

Oracle database version you are using
Oracle 9i

Java version you are using
JDK1.5

JDBC driver
ORacle JDBC DRIVER
*********************************************************

entire error message and stack trace you are getting

java.lang.ClassCastException: org.apache.commons.dbcp.PoolableConnection
at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:87)
at com.message.dao.MessageCenter.insertNewMessage(MessageCenter.java:514)
at com.message.action.PopulateAction.execute(PopulateAction.java:202)
***********************************************************

the part of your java code that is causing the error

String[] str = {"MAST","MAST"};

//LINE 514
ArrayDescriptor desc = ArrayDescriptor.createDescriptor("PCKOMSMM100.CUST_NMBR_TABLE", con);

ARRAY newArray = new ARRAY(desc, con, str);
stmt.setArray(2,newArray);
*********************************************************
the call-spec for your PL/SQL procedure

It is part of a package PCKOMSMM100
Type CUST_NMBR_TABLE is table of VARCHAR2(30) ;

FUNCTION insertMessage (
CUST_IDS_LIST IN CUST_NMBR_TABLE
)
*******************************************************

Thanks
Gublooo
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Passing Array to Stored Procedure