开发者

Weblogic 10.3 ClassCast exception for OracleConnection

开发者 https://www.devze.com 2023-01-09 01:38 出处:网络
I am trying开发者_开发技巧 to send the database Array by using the method below: OracleConnection oracleConnection = (OracleConnection) ((WLConnection)connection).getVendorConnection(); -- Exception

I am trying开发者_开发技巧 to send the database Array by using the method below:

OracleConnection oracleConnection = (OracleConnection) ((WLConnection)connection).getVendorConnection(); -- Exception in this LINE
ArrayDescriptor arrayDesc = ArrayDescriptor.createDescriptor( "MY_ARRAY", oracleConnection);
String vals = {"1", "2"}
ARRAY ocbsArray = new ARRAY(arrayDesc, oracleConnection, vals);

Exception:

We are not having the WLConnection class in weblogic.jar in weblogic 10.3.

If I just send the typecasted oracleConnection object to the createDescriptor() method, I get the following exception:

java.lang.ClassCastException: $Proxy439 cannot be cast to oracle.jdbc.OracleConnection
at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:155)
at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:123)


We should use com.bea.core.datasource module jar, in our weblogic modules directory. This has the class WLConnection.

0

精彩评论

暂无评论...
验证码 换一张
取 消