开发者

Configuring Data Source in WebSphere 6.1 for Oracle 11g XML-DB support

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


Try this and see if that provides you with the required answers

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

HTH

Manglu


I understand that you don't want to dive down the WSCallHelper swamp, but unfortunately I have to concur with prevailing suggestion. I had a similar situation a while back with Oracle and CLOB/BLOB (before they implemented that according to the JDBC standards in the driver) and WSCallHelper was really the only way forward when you have to access the raw JDBC driver in a container managed resource/pool.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜