OracleConnection 的 Weblogic 10.3 ClassCast 异常
我尝试使用以下方法发送数据库数组:
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);
异常:
我们在 weblogic 10.3 的 weblogic.jar 中没有 WLConnection 类。
如果我只是将类型转换的 oracleConnection 对象发送到 createDescriptor() 方法,则会出现以下异常:
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)
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)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我们应该使用 weblogic 模块目录中的 com.bea.core.datasource 模块 jar。
它具有 WLConnection 类。
We should use com.bea.core.datasource module jar, in our weblogic modules directory.
This has the class WLConnection.