File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Null pointer while using BLOB Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Null pointer while using BLOB" Watch "Null pointer while using BLOB" New topic
Author

Null pointer while using BLOB

Sekhar Kapoor
Greenhorn

Joined: Apr 24, 2007
Posts: 15
I am trying to extract a file name and its data from the database. The file data is stored as HUGEBLOB in the table. The file contains data which I found by downloading it directly from table using TOAD. However when I try to fetch the data throughh Java code :
Blob file = rs.getBlob("file_data");
I am getting null pointer in the next line which is:
InputStream inputStream = ((oracle.sql.BLOB)file).getBinaryStream();

Can anyone suggest why it is giving null exception and what is the solution to it.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel
 
subject: Null pointer while using BLOB
 
Similar Threads
How to upload a byte array into BLOB column?
BLOB throwing class cast exception
Parsing a BLOB XML object
Hibernate BLOB retrieving
problem uploading file in oracle databse