File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and the fly likes java.lang.Classcast exception in ArrayDescriptor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "java.lang.Classcast exception in ArrayDescriptor" Watch "java.lang.Classcast exception in ArrayDescriptor" New topic
Forums: JDBC Oracle/OAS

java.lang.Classcast exception in ArrayDescriptor

Biplab Mishra

Joined: Jul 22, 2011
Posts: 4
HI All,

We are facing below java.lang.ClassCastException inside a java stored procedure when using ArrayDescriptoy. We have a pl/sql procedure which internally calling a java stored procedure and the error is coming while associating the sql type with connection object in ArrayDescriptor.

Below is the error


at oracle.sql.ArrayDescriptor.createDescriptor(

at oracle.sql.ArrayDescriptor.createDescriptor(

at oracle.sql.ArrayDescriptor.createDescriptor(

at oracle.sql.ArrayDescriptor.createDescriptor(

at TestDatabase.addNumbers1(TestDatabase:92)

My Java Code

conn = (OracleConnection) DriverManager

List al = new ArrayList();

al.add("Plain Text");

Object[] arrayToPassToDB = globalToDBArrayForamt(al, 6);

String procedure = "{CALL study_definition_api_pkg.pr_control_study_load(?,?,?)}";

String arrayDesc = "CONTROL_STUDY_TAB";

CallableStatement st = con.prepareCall(procedure);

ArrayDescriptor des = ArrayDescriptor.createDescriptor(arrayDesc, con); -- this is causing error
I agree. Here's the link:
subject: java.lang.Classcast exception in ArrayDescriptor
Similar Threads
Passing Array to Stored Procedure
classcast exception only with websphere server not for weblogic
cannot create oracle.sql.ArrayDescriptor using connection from weblogice datasource
Getting array of Oracle Objects
java.lang.ClassCastException: $Proxy0 cannot be cast to oracle.jdbc.OracleConnection