OracleConnection 的 Weblogic 10.3 ClassCast 异常

发布于 2024-09-11 13:36:32 字数 770 浏览 1 评论 0原文

我尝试使用以下方法发送数据库数组:

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

少女七分熟 2024-09-18 13:36:32

我们应该使用 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文