File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Problem using OracleArray Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Problem using OracleArray" Watch "Problem using OracleArray" New topic

Problem using OracleArray

V Katiyar

Joined: Jan 27, 2005
Posts: 3
I am trying to use on WLS8.1 sp4 to read out VARRAY of a type in Oracle (it is an array of Oracle type). I have followed the instructions in I get the following error.
java.lang.ClassCastException: weblogic.jdbc.rmi.SerialArray_weblogic_jdbc_rmi_internal_ArrayStub_weblogic_jdbc_rmi_internal_ArrayImpl_weblogic_jdbc_wrapper_Array_oracle_sql_ARRAY_814_WLStub

My Datasource is configured to use the Oracle thin driver ...9.x

<Code Snippet>
Connection con = .............
stmt = con.prepareCall("Call myproc (?,?)");
java.util.Map map = con.getTypeMap();
map.put("MYAPP.V_ARRAY", Class.forName("util.MyArraySQLData"));
Array sqlArray = stmt.getArray(2);
fails====> oracleArray = ( )sqlArray;
} catch(Exception ex) {
</Code Snippet>

I would appreciate any pointers.
stu derby
Ranch Hand

Joined: Dec 15, 2005
Posts: 333
I'm really really guessing here, but what I'm guessing is that your alteration of the type map is what's tripping you up.

If my guess is right, then either you need to not alter the type map, or util.MyArraySQLData needs to either implement or extend something that it doesn't currently (like oracle.sql.ARRAY).

Sorry, I can't be more helpful, this stuff is just past the boundary of what I really know... If you figure it out, please post a followup, so we can learn from your suffering...
I agree. Here's the link:
subject: Problem using OracleArray
It's not a secret anymore!