Get your CodeRanch badge!*
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem using OracleArray
 
Similar Threads
OracleClob
Mixing JDBC and CMP code -> leaked connections
Class path problem while creating weblogic DB2 driver connection pool
How to know the free memory of single Nodes in a Cluster?
Whacky db problem.