This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript 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: 41592
    
  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: 41592
    
  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: 41592
    
  55
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