我得到了`DSRA9122E:com.ibm.ws.rsadapter.jdbc.WSJdbcConnection@d3t7e556不包装任何类型为oracle.jdbc.OracleConnection的对象 [英] I get the `DSRA9122E: com.ibm.ws.rsadapter.jdbc.WSJdbcConnection@d3t7e556 does not wrap any objects of type oracle.jdbc.OracleConnection

查看:305
本文介绍了我得到了`DSRA9122E:com.ibm.ws.rsadapter.jdbc.WSJdbcConnection@d3t7e556不包装任何类型为oracle.jdbc.OracleConnection的对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Websphere 18 Liberty版本.尝试将java.sql.connection解包到oracle.jdbc.OracleConnection时,我得到

Am using Websphere 18 Liberty Version. When am trying to unwrap java.sql.connection to oracle.jdbc.OracleConnection I get the

`DSRA9122E:com.ibm.ws.rsadapter.jdbc.WSJdbcConnection@d3t7e556确实 不包装任何类型为oracle.jdbc.OracleConnection的对象

`DSRA9122E: com.ibm.ws.rsadapter.jdbc.WSJdbcConnection@d3t7e556 does not wrap any objects of type oracle.jdbc.OracleConnection

在sever.xml文件中,使用ojdbc7.jar作为数据源,同样在应用程序中,我从相同位置添加了相同的jar.仍然面临着这个问题.我提到了所有链接 WSJDBCConnection不会包装oracle类型的对象.jdbc.OracleConnection 这样.仍然面临着同样的问题.

In sever.xml file am using ojdbc7.jar for datasource, also in application I added same jar from the same location. Still am facing the issue. I referred all links WSJDBCConnection does not wrap objects of type oracle.jdbc.OracleConnection like this. Still am facing the same issue.

推荐答案

为使Connection.unwrap正常工作,Liberty DataSource和应用程序都必须从同一个加载供应商实现类(oracle.jdbc.OracleConnection)类加载器.

In order for Connection.unwrap to work properly, the Liberty DataSource and the Application must both load the vendor implementation class (oracle.jdbc.OracleConnection) from the same class loader.

这是一个简单的示例,说明如何配置dataSource和应用程序以使用相同的类加载器从包含Oracle JDBC驱动程序的单个库中加载

Here is a simple example of how to configure both the dataSource and your application to use the same class loader to load from a single library that contains the Oracle JDBC driver,

<library id="OracleLib">
    <fileset dir="${server.config.dir}/oracle"/>
</library>

<application location="myApp.war" >
    <classloader commonLibraryRef="OracleLib"/>
</application>

<dataSource jndiName="jdbc/oracleDataSource">
    <jdbcDriver libraryRef="OracleLib"/>
    <properties.oracle .../>
</dataSource>

这篇关于我得到了`DSRA9122E:com.ibm.ws.rsadapter.jdbc.WSJdbcConnection@d3t7e556不包装任何类型为oracle.jdbc.OracleConnection的对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆