my dog learned polymorphism*
The moose likes Websphere and the fly likes Oracle Array objects using connection pooling in Websphere Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Websphere
Bookmark "Oracle Array objects using connection pooling in Websphere" Watch "Oracle Array objects using connection pooling in Websphere" New topic
Author

Oracle Array objects using connection pooling in Websphere

Prashanth menon
Ranch Hand

Joined: Feb 20, 2001
Posts: 65
Hi all,
I tried passing ARRAY object from java to oracle which in turn returns another array. This worked with the thin connection. But when I used Connection pooling of Websphere, this failed. Throws me out at the point where I create the ArrayDescriptor object. The Code is as follows.
String[] strArrayr={"12","13","14"};
//DATA_1_COL_TY is an oracle collection type and con is a Connection object.
ArrayDescriptor arrVarcharDesc=ArrayDescriptor.createDescriptor("DATA_1_COL_TY", con);
ARRAY arr = new ARRAY(arrVarcharDesc, connectionDb, strArrayr);
OracleCallableStatement callStmt = (OracleCallableStatement) con.prepareCall(
"{ call get_orders(?,?)}");
callStmt.setArray(1, arr);
callStmt.registerOutParameter(
2,
OracleTypes.ARRAY,
"DATA_2_COL_TY");
….
The exception raised is
java.lang.ClassCastException: com.ibm.ejs.cm.proxy.OracleConnectionProxy
Is it by any chance possible to implement the above using a connection pooling in websphere. Looks like it is possible in Oracle AS.
Thank you
Prashanth
Claire Zora
Greenhorn

Joined: Feb 03, 2003
Posts: 2
Hi,
I have exactly the same problem. Apparently regardless of which driver you say you want to use, was always takes ibm implementations of data source & connexion pool.
For the time beeing, I have resolved this problem by bypassing was datasource declaration.
I have declared in a static block my own Oracle Datasource, binded it in JNDI and then I retrieve it later as usual.
Therefore I can use exactly the code you wrote, and all castings are fine.
This method is OK (ie it works) but I'm not totally satisfied with the "beauty of it", so if anyone has any suggestions ?...
May I had that weblogic acts axactly as Was with weblogic implementations.
Rgds,
Claire.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Oracle Array objects using connection pooling in Websphere
 
Similar Threads
Passing Arrays to Oracle stored procedures
ClassCastException in Weblogic 5.1 while using OracleCallableStatement
Array objects using connection pooling in WebSphere
Calling Stored procedures
Getting array of Oracle Objects