SunQuest
           Java Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesJava Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now!
  #1  
Old February 21st, 2002, 05:43 AM
loneill loneill is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2002
Posts: 0 loneill User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy extracting data

I want to extract files from my database so my administrator can view these files. The files can be either images or .doc's. Does anybody have any ideas how i could do this.

Reply With Quote
  #2  
Old February 21st, 2002, 06:20 AM
oscagne oscagne is offline
Java Developer
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2001
Posts: 5 oscagne User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi,

You can store them as blobs (binary large objects) or clobs(character large objects), if your database will support them. Though you can't treat them the same as you would other data that you insert/retrieve from a db, you instead have to get a reference to them from the db and use a (input/ouptut)stream to write/read from them.

Once you've got them you can stream them to the client on the servletOutputStream, and set the contentType to the relevant type (must be done before opening the stream if I remember rightly though).

Is this the kind of answer you were looking for?

This isn't pretty, and if you can avoid it I would. If it is secure you could always use the db to store the file name and path, then just redirect a browser to the specified file. Clobs and Blobs are as far as I'm aware not even stored in the main db, they are more like pointers to files that external to the db

Oscagne

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesJava Help > extracting data


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway