File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Compress Data using Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Compress Data using Java" Watch "Compress Data using Java" New topic

Compress Data using Java

Ketul Parikh

Joined: Jul 17, 2009
Posts: 14

There is an existing system in my company, where we are having 40 blob fields in a table.
Now we have decided to implement RSA, and we are now storing encrypted values.

When inserting Database gives error that it can only store 8000 bytes per row..

Of course now since encryption implementation is necessary and table design, though poor, cannot be changed..

I was thinking of Data Compression before inserting Data into the DB so that it can be stored within 8000 bytes.

Just for knowledge, we are using SQL Server 2000

Can Someone Help??

Ireneusz Kordal
Ranch Hand

Joined: Jun 21, 2008
Posts: 423
Look at java.util.Zip package:
it has compression utilities.
Here is a tutorial from Sun ... ops ... now from Oracle
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
Be sure to perform the compression before the encryption, since encrypted files have a high entropy that makes them much less amenable to compression.
Ketul Parikh

Joined: Jul 17, 2009
Posts: 14
Thankx to All..
I agree. Here's the link:
subject: Compress Data using Java
It's not a secret anymore!