I am fairly new at this so I may be way off but it is probably better to use the java.sql.Blob class instead of the Oracle specific BLOB object.
Blob blob = rs.getBlob(1);
Your class cast exception comes from the fact that the ResultSet you get back does not inherit from the Oracle version. I don't think you can use JBoss connection pooling and still use the non-standard Oracle functionality. If you need the Oracle functionality you will have to use the DriverManager.getConnection(url). Or at least that is what I have found.
I am intending to save a blob to the table and not retrieve it.The original code saves a blob to the database.
Blob interface which is provided by java.sql.* package doesnt have any method which returns the outputstream object.
That is the reason why I have used BLOB of oracle.sql package.
I tried this code but it throws the following compilation error.
cannot resolve symbol
symbol : method getUnderlyingResultSet ()
location: interface java.sql.ResultSet
Compiler tries to find the method getUnderlyingResultSet() in java.sql.ResultSet interface which it doesnt find hence the error.
You must cast the 'rs' object to "org.jboss.pool.jdbc.ResultSetInPool" before you can call the getUnderlyingResultSet method.
BLOB blob =
Let me know if that works as I have not tried it.
Yes, use your imagination;-). You may also need to cast to the Oracle blob type.