ClassCastException for WrappedConnection in Jboss
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 );
精彩评论