>This code always throws a ClassCastException on this line: ><code> >oracle.sql.BLOB blob = (oracle.sql.BLOB) foo.getBlob(); ></code> I'm using Hibernate3 and I was experiencing the same problem, but in my cas e I got a ClassCastException of type org.hibernate.lob.SerializableBlob. I found a solution in this way: [...] org.hibernate.lob.SerializableBlob sBlob = (org.hibernate.lob.SerializableBlob)foo.getBlob(); oracle.sql.BLOB blob = (oracle.sql.BLOB)sBlob.getWrappedBlob(); java.io.OutputStream pw = blob.getBinaryOutputStream(); [...] Hope it helps