Win a copy of Head First Android this week in the Android forum!
  • 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

java.lang.Classcast exception in ArrayDescriptor

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic