File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes java.sql.SQLException: ORA-01407: Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "java.sql.SQLException: ORA-01407:" Watch "java.sql.SQLException: ORA-01407:" New topic

java.sql.SQLException: ORA-01407:

Surya Ram

Joined: Aug 09, 2004
Posts: 7
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);
byte[] byteArray = (byte[])(byteStream.toByteArray());
ByteArrayInputStream stream = new ByteArrayInputStream(byteArray);
Lisa D'Aniello
Ranch Hand

Joined: Sep 25, 2003
Posts: 42
Hi Surya,

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!
Julian Kennedy
Ranch Hand

Joined: Aug 02, 2004
Posts: 823
Here is some code I found on Sun's forum, commented with step-by-step instructions:

You need to import part of the oracle.sql package.

I hope this helps.

Avi Abrami
Ranch Hand

Joined: Oct 11, 2000
Posts: 1141

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.

Good Luck,
pascal monfils

Joined: Aug 09, 2004
Posts: 9
thanks for your help !

Your thread was greatly helpfull.
I agree. Here's the link:
subject: java.sql.SQLException: ORA-01407:
It's not a secret anymore!