Somu
Somu

Reputation: 3750

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

Upvotes: 0

Views: 2122

Answers (2)

pap
pap

Reputation: 27614

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.

Upvotes: 0

Manglu
Manglu

Reputation: 11344

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

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

HTH

Manglu

Upvotes: 1

Related Questions