[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 :
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]
-------------- 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