This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC 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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Problem using OracleArray" Watch "Problem using OracleArray" New topic
Author

Problem using OracleArray

V Katiyar
Greenhorn

Joined: Jan 27, 2005
Posts: 3
I am trying to use weblogic.jdbc.vendor.oracle.OracleArray 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 http://edocs.bea.com/wls/docs81/jdbc/thirdparty.html#1043614. 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>
try{
Connection con = .............
stmt = con.prepareCall("Call myproc (?,?)");
stmt.setInt(1,num);
stmt.registerOutParameter(2,java.sql.Types.ARRAY,"MY_ARRAY");
java.util.Map map = con.getTypeMap();
map.put("MYAPP.V_ARRAY", Class.forName("util.MyArraySQLData"));
stmt.execute();
Array sqlArray = stmt.getArray(2);
fails====> weblogic.jdbc.vendor.oracle.OracleArray oracleArray = (weblogic.jdbc.vendor.oracle.OracleArray )sqlArray;
..........
.........
} catch(Exception ex) {
ex.printStackTrace();
}
</Code Snippet>

I would appreciate any pointers.
regards
V.
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...
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Problem using OracleArray
 
Similar Threads
How to know the free memory of single Nodes in a Cluster?
Mixing JDBC and CMP code -> leaked connections
Whacky db problem.
OracleClob
Class path problem while creating weblogic DB2 driver connection pool