[jboss-user] [JCA] - Classcast Exception using Oracle Blobs(10g) and JBoss 4.0

satwika C do-not-reply at jboss.com
Fri Sep 24 01:19:59 EDT 2010

satwika C [http://community.jboss.org/people/satwika.chandra] created the discussion

"Classcast Exception using Oracle Blobs(10g) and JBoss 4.0"

To view the discussion, visit: http://community.jboss.org/message/563449#563449

Hi all,

Im using oracle 10g and JBoss 4.

Im getting the following error :


: oracle.sql.BLOB

 Conn = DBConnector.getConnection();
// Initially inserted an empty_blob() to data base

//retrieving the record and locking it.
 PreparedStatement pStatement = conn.prepareStatement("Select ............... for Update")
ResultSet result = pStatement.executeQuery();

BLOB blob =((OracleResultSet)result).getBLOB(1);

OutputStream outStream = blob.setBinaryStream(1L);

int size = blob.getBufferSize();  
byte[] buffer = new byte[size];  
int length = -1;  

while ((length = inputStream.read(buffer)) != -1)

outStream.write(buffer, 0, length);

Ive also tried casting my ResultSet obj with WrappedResultSet of org.jboss.resource.adapter package.
This is also throwing a classcastexception.

Please provide a solution.

Sat !

Reply to this message by going to Community

Start a new discussion in JCA at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100924/fc913fed/attachment.html 

More information about the jboss-user mailing list