Reading of Oracle BLOB works with JBoss 3.2.3 but fails with
vollesommi67 Aug 30, 2004 5:31 AMWith JBoss 3.2.3 the following works without any problems. Yet, with JBoss 3.2.5 there is a ClassCastException:
I read a BLOB from an Oracle database:
//rset comes from a statement such as SELECT blob_data from test_table; if (logger.isInfoEnabled()) logger.info("Class of the resultSet: " + rset.getClass().getName()); InputStrean inStream = ((OracleResultSet)rset).getBLOB(1).getBinaryStream();
With JBoss 3.2.3, the class of the result set is an Oracle result set:
INFO (OracleAuthenticationServer.java : 694) - Class of the resultSet: oracle. jdbc.driver.OracleResultSetImpl
Yet, with JBoss 3.2.5 it is a wrapper class. Therefore I get a ClassCastException:
11:09:59,804 INFO [OracleAuthenticationServer] Class of the resultSet: org.jbos s.resource.adapter.jdbc.WrappedResultSet 11:09:59,804 ERROR [LogInterceptor] RuntimeException: java.lang.ClassCastException at de.srp_gmbh.db.OracleDatabaseAdapter.getOracleResultSet(OracleDatabas eAdapter.java:251) at de.srp_gmbh.oma.server.authentication.OracleAuthenticationServer.chec kUser(OracleAuthenticationServer.java:695) at de.srp_gmbh.oma.server.authentication.AbstractSQLAuthenticationServer .validUser(AbstractSQLAuthenticationServer.java:574) at de.srp_gmbh.oma.server.authentication.AuthenticationServer.validUser( AuthenticationServer.java:387) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(S tatelessSessionContainer.java:683) at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invo ke(CachedConnectionInterceptor.java:185) at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(Stat elessSessionInstanceInterceptor.java:72) at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte rceptor.java:84) at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep torCMT.java:282) at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:1 48) at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor. java:120) at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191) at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFacto ryFinderInterceptor.java:122) at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessi onContainer.java:331) at org.jboss.ejb.Container.invoke(Container.java:723) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher. java:60) at org.jboss.mx.server.Invocation.dispatch(Invocation.java:61) at org.jboss.mx.server.Invocation.dispatch(Invocation.java:53) at org.jboss.mx.server.Invocation.invoke(Invocation.java:86) at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker. java:185) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473) at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java: 360) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261) at sun.rmi.transport.Transport$1.run(Transport.java:148) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.Transport.serviceCall(Transport.java:144) at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4 60) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport .java:701) at java.lang.Thread.run(Thread.java:534)
How can I extract the Oracle result set from the wrapper class?