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 :



java.lang.ClassCastException


: 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();
System.out.println(result.getClass().getName());

result.next();
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);
inputStream.close();
outStream.close();



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.

Thanks,
Sat !
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/563449#563449]

Start a new discussion in JCA at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2098]

_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to