Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Can't cast ResultSetProxy to oracle.jdbc.driver.ResultSet using datasource
Hi-
I'm running Websphere 4.0.1 on Win2k using Oracle 8.1.6 as my
application's database. (DB2 is used for WS persistence).
My application pools connections either either a custom written
manager, using DriverManager, or using a Datasource object. As part
of the project, I need to store CLOB's and BLOB's in Oracle. Using a
connection obtained from a driver manager, the CLOB is written the to
the db as follows:
Connection conn = getConnection();
// ... an insert is performed using (?, ?, ?, empty_clob())...
Statement statement = null;
javax.sql.ResultSet resultSet = null;
statement = conn.createStatement();
resultSet = statement.executeQuery( "Select * from table where ...."
);
resultSet.next();
try {
oracle.sql.CLOB clobDB =
((oracle.jdbc.driver.OracleResultSet)resultSet).getCLOB("Data");
clobDB.putString( 1, getMsgHeader().marshall() ); } catch (Exception e) {}
Now, all of this takes place using WS and Oracle, getting a
connection from DriverManager. Switch the code to use the DataSource
(and thereby, oracle.jdbc.pool.OracleConnectionPoolDataSource), and
when I reach the point in the above code where I type the resultSet to
an OracleResultSet, the following exception is thrown:
java.lang.ClassCastException: com.ibm.ejs.cm.proxy.ResultSetProxy
For some reason, the type of resultSet being returned to me is different in the case of the DriverManager and the Datasource. I'd appreciate any suggestions on how to re-work the code to accomodate for the resultset, or examples on how to better insert and update the CLOB to avoid the problem altogether. Thanks for your help. Joe Received on Tue Apr 23 2002 - 19:56:26 CDT