【发布时间】:2013-04-16 09:41:28
【问题描述】:
WrappedConnectionJDK6 wrapped = (WrappedConnectionJDK6) dbStrategy.getConnection();
Connection underlyingConn = wrapped.getUnderlyingConnection();
OracleConnection oracleConn = (OracleConnection)underlyingConn;
最后一行给出错误 -
> ERROR
> [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/web].[resteasy-servlet]]
> (http-/0.0.0.0:8080-1) Servlet.service() for servlet resteasy-servlet
> threw exception: org.jboss.resteasy.spi.UnhandledException:
> java.lang.ClassCastException: oracle.jdbc.driver.T4CConnection cannot
> be cast to oracle.jdbc.OracleConnection
【问题讨论】:
-
还有什么问题?
-
需要从 WrappedConnectionJDK6 获取 oracle 连接 .. 但它给出了转换问题 .. 任何线索如何从 WrappedConnectionJDK6 中获取 oracle 连接?
-
JBoss 用它自己的 (org.jboss.jca.adapters.jdbc.jdk6.WrappedConnectionJDK6) 包装 oracle 连接。我正在尝试调用 #getUnderlyingConnection() 来获取底层连接。但是在将其转换为 Oracle 连接时,它给出了错误...连接转换错误