null pointr excep in preparedStatement.setBinaryStream(5,is,file.length())
Hi
I am getting null pointer exception when i try to update a blob using preparedStatement.setBinaryStream(5,is,file.length())
Please note that the preparedstatement is not null
the inputstream and the file is also not null
Infact i am able to buffer this stream..However when i do setBinaryStream, i am getting null pointer exception.
Please help
Thanks
[397 byte] By [
Sid888a] at [2007-11-27 3:33:30]

# 1
Where exactly does this nullpointerexception come from? Do a sysout of preparedStatement, is and file.length() before.You may try to use is.available() instead of file.length(). You can also try PreparedStatement#setBytes() instead of setBinaryStream().
# 2
Hi I have to update a Blob object and setBinaryStream is the best way to do it. Neither the filestream object or the file.length is null.I am getting proper values for all these . Only when i do the operation, setBinaryStream, I am getting nullpointer exception
# 8
That's an old driver. It is not supported in there. Use setBLOB instead.
Also see:
http://download-west.oracle.com/docs/cd/B10501_01/java.920/a96654/datacc.htm
http://download-west.oracle.com/docs/cd/B10501_01/java.920/a96654/oralob.htm#1043272
I am not sure if a driver upgrade would help, I don't have much experience with Oracle stuff. But you now know the cause at least :)