• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

problem uploading file in oracle databse

Ranch Hand
Posts: 809
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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

[ August 26, 2007: Message edited by: Naseem Khan ]
    Bookmark Topic Watch Topic
  • New Topic