jQuery in Action, 2nd edition*
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
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: 41106
    
  45
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: 41106
    
  45
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: 41106
    
  45
What are you looking for that's not explained on the "Examples" page?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need help to save .tar files in data base
 
Similar Threads
java API to extract ZIP, RAR and TAR files
Implement JAAS in Struts
Tar a folder excluding pdf's
Java Servlet - Download Multiple files
Archiving files in UNIX