File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem uploading file in oracle databse

 
Naseem Khan
Ranch Hand
Posts: 809
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a requirement where I have to store files of following formats in oracle database as a Blob.

File Formats are: .txt, .rtf, .doc, .xls, .pdf, .gif, .jpeg, .png.

Technologies which I am using are flex, spring and hibernate. Backend is oracle with thin driver. System allows user to choose file from flex mxml page, it makes a HTTPService call to a servlet where I am getting inputstream object from the request.

Now my question is how do I use this inputstream object with blob.

I know if I can do it by writing simple jdbc code then I can do the same by hibernate.

Few ways which I found from google are:

1. insert a empty_blob() in that column,
2. load that column to get its pointer. Get it from ResultSet
3. Read byte from inputstream and write it in the outputstream pointing to the blob column.

I am able to write the data in the database column by above approach but not more than 3 kb. I don't know what is the problem. In my case file size is maximum 12 MB.

Second approach which I got from google is by class SQLUpdate. But it did not work.

Please help me guys.

Waiting for your reply

Rgds,
Naseem
[ August 26, 2007: Message edited by: Naseem Khan ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic