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 java.lang.Classcast exception in ArrayDescriptor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
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
Author

java.lang.Classcast exception in ArrayDescriptor

Biplab Mishra
Greenhorn

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
============

java.lang.ClassCastException
at
oracle.jdbc.driver.PhysicalConnection.putDescriptor(PhysicalConnection.java:527

)
at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:197

at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:164

at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:149

at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:114

at TestDatabase.addNumbers1(TestDatabase:92)



My Java Code
=========

conn = (OracleConnection) DriverManager
.getConnection("jdbc:default:connection:");


List al = new ArrayList();

al.add("V419006");
al.add("Plain Text");
al.add("Cumulative");
al.add("0");
al.add("|");
al.add("V419-006");
al.add("V419-006");

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
 
 
subject: java.lang.Classcast exception in ArrayDescriptor