• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Passing Array to Stored Procedure

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I read the solution that AVI provided in the following topic:
https://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
 
reply
    Bookmark Topic Watch Topic
  • New Topic