wood burning stoves 2.0*
The moose likes JDBC and the fly likes Need help to save .tar files in data base Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Need help to save .tar files in data base" Watch "Need help to save .tar files in data base" New topic
Author

Need help to save .tar files in data base

Apeksha Badagavi
Greenhorn

Joined: Jan 03, 2011
Posts: 3
I want to insert .tar files into the DB. Is there any option of directly doing it? Or any other approach to follow upon.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41635
    
  55
Sounds like you need a BLOB field. You may want to compress the files before storing them (maybe using GZIP).


Ping & DNS - my free Android networking tools app
Apeksha Badagavi
Greenhorn

Joined: Jan 03, 2011
Posts: 3
Is GZIP used to decompress the .tar files? Cause I have tried using Zip, but it didnt work on the .tar files.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41635
    
  55
GZIP -just like ZIP- is a compression and decompression method. Both work fine for TARs if you do it right. TAR itself is not compressed, just archived. The Commons Compress library (http://commons.apache.org/compress/) has everything you need to make working with TARs as easy as working with ZIP/GZIP.
Apeksha Badagavi
Greenhorn

Joined: Jan 03, 2011
Posts: 3
Do you have a sample java code for this?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41635
    
  55
What are you looking for that's not explained on the "Examples" page?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Need help to save .tar files in data base