• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need help to save .tar files in data base

 
Apeksha Badagavi
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like you need a BLOB field. You may want to compress the files before storing them (maybe using GZIP).
 
Apeksha Badagavi
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is GZIP used to decompress the .tar files? Cause I have tried using Zip, but it didnt work on the .tar files.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have a sample java code for this?
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What are you looking for that's not explained on the "Examples" page?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic