0

I am using Oracle's XML database feature and the column is defined as SYS.XMLTYPE. I am using the below JDBC code to select/update this field.

XMLType xmlType = (XMLType) rs.getObject(1);
stmt.setObject(1, XMLType.createXML(connection, xmlString));

I had to configure the data source in Tomcat's context.xml as below to get it to work (by adding the following type, factory and driverClassName).

    <Resource
               type="oracle.jdbc.pool.OracleDataSource"
               factory="oracle.jdbc.pool.OracleDataSourceFactory"
               driverClassName="oracle.jdbc.driver.OracleDriver"
               ...

However, when deploying in WebSphere I am getting the below Exceptions. Could anybody help me with the equivalent data source configuration in WAS 6.1 to get rid of these errors?

java.lang.ClassCastException: oracle.sql.OPAQUE incompatible with oracle.xdb.XMLType
java.lang.ClassCastException: com.ibm.ws.rsadapter.jdbc.WSJdbcConnection incompatible with oracle.jdbc.OracleConnection
4

2 回答 2

1

试试这个,看看它是否为您提供了所需的答案

http://community.jboss.org/wiki/MappingXMLToOracleXMLTYPEInIBMWebspsherePlatform

高温高压

芒鲁

于 2011-07-08T00:13:56.020 回答
0

我了解您不想潜入 WSCallHelper 沼泽,但不幸的是,我必须同意普遍的建议。不久前,我在 Oracle 和 CLOB/BLOB 中遇到过类似的情况(在他们根据驱动程序中的 JDBC 标准实现之前),当您必须访问容器管理资源中的原始 JDBC 驱动程序时,WSCallHelper 确实是唯一的前进方式/水池。

于 2011-07-25T11:08:15.560 回答