2 Replies Latest reply on Feb 8, 2008 2:15 AM by jaikiran pai

    How to get access to OracleDriver java.sql implementations ?

    Peter Reitsma Newbie


      I am working on JBoss 4.0.2. and configured a local tx datasource to an Oracle 9.2 database using Oracle's ojdbc14 driver of same version.

      I managed to get a handle to the java.oracle.BLOB using this code.

      rs = pstmt.executeQuery();
      //fetch the underlying resultset from the JBoss Wrap
      ResultSet underlyingResultSet = ((org.jboss.resource.adapter.jdbc.WrappedResultSet)rs).getUnderlyingResultSet();
      //then cast to the OracleResultSet to get an Oracle BLOB
      oracle.sql.BLOB blob = ((oracle.jdbc.driver.OracleResultSet)underlyingResultSet).getBLOB("BLOB");

      However, this doesn't work anymore.

      For some reason I now get Classcast exceptions. It seems that all java.sql classes like the Connection, ResultSet, PreparedStatement and even the DataSource suddenly are dynamic proxies which can't be cast to anything except the interface they implement. Where are the wrappers ?

      How can I get access to the Oracle classes and still use a datasource configuration ?
      Do I need to use the XADatasource and a ConnectionPoolDataSource?
      Or does anybody know if and how it is possible to insert an Oracle BLOB using plain JDBC ?