开发者

ClassCastException for WrappedConnection in Jboss

开发者 https://www.devze.com 2023-01-17 02:43 出处:网络
ClassCastException for WrappedConnection in Jboss Hi, I am using STRUCT I开发者_运维问答N my program.

ClassCastException for WrappedConnection in Jboss

Hi, I am using STRUCT I开发者_运维问答N my program. While using the connection from JNDI lookup, I am getting

java.lang.ClassCastException: org.jboss.resource.adapter.jdbc.WrappedConnection

PLEASE HELP OUT


Adding an update for the a resolution to this problem...

I add a cast to the connection class, changing it from java.sql.Connection to org.jboss.resource.adapter.jdbc.WrappedConnection, this being the actual class that is returned from the pool. This allowed me to gain acces to the Oracle connection that contains the implementation that I need for Oracle specific operations. Once I did that, the cast exception went away. I only did this in specific instances where my java class was using an Oracle JDBC component. Now, the code looks this:

Connection jbossConn = ((WrappedConnection) this.connection).getUnderlyingConnection(); ArrayDescriptor descriptor = ArrayDescriptor.createDescriptor( Oracle Dictionary Type, jbossConn );

0

精彩评论

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