• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

problem uploading file in oracle databse  RSS feed

 
Ranch Hand
Posts: 809
  • 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 ]
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!