On my case, this code snippets runs on Oracle 9i, but when I deploy the WAR  
using Oracle 10g as the backend, exception occured on casting
 
here is the code:

if (id!= null) {
                    stmt2=conn.prepareStatement("SELECT content from 
pps_designdocument_revs where id = "+id);
                    rs=stmt2.executeQuery();
                    if (rs!=null && rs.next()){
                        oracle.sql.BLOB objectBlob = 
(oracle.sql.BLOB)rs.getObject("CONTENT");
                        byte[] buffer = new byte[objectBlob.getBufferSize()];
                        int bytesRead = 0;
                        inputStream = desDocRev.getContents();
                        outputStream = objectBlob.getBinaryOutputStream();
                        while ((bytesRead = inputStream.read(buffer)) != -1){
                            outputStream.write(buffer, 0, bytesRead);
                        }
                        outputStream.flush();
                        outputStream.close();
                        inputStream.close();
                        conn.commit();
                    }
                    DataSourceBroker.close(rs);
                    DataSourceBroker.close(stmt2);
                }else{
                    conn.rollback();
                }

Here is the error:

javax.servlet.ServletException: oracle.sql.BLOB cannot be cast to 
oracle.sql.BLOB




View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4049572#4049572

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4049572
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to