Hello, I am updating the BLOB in Oracle and using setBinaryStream(1,stream,length) I get the following error. It happens in some cases only....
---java.sql.SQLException: ORA-01407: cannot update ("SCHEMA"."BLOB"."BLOB") to NULL
here is the code I used to get the stream ******************************** ByteArrayOutputStream byteStream = new ByteArrayOutputStream(); ObjectOutputStream objStream = new ObjectOutputStream(byteStream); objStream.writeObject(obj); objStream.flush(); System.out.println("objStream"+objStream.toString()); System.out.println("byteStream-------------------"+byteStream.toString()); byte byteArray = (byte)(byteStream.toByteArray()); ByteArrayInputStream stream = new ByteArrayInputStream(byteArray);
I think you are missing a couple of steps, and maybe have a couple backwards (or maybe you didn't post all of your code???). I cannot see where you are defining your blob locator, nor the information that you plan on sending.
If you could post all of your code that pertains to the blob, I bet we could get you up and running in no time!
Surya, Pardon me if I am stating the obvious, but according to the error message you have posted, column BLOB, in table BLOB, owned by user SCHEMA is a mandatory (or "not null") column, and you are trying to set it to null.