wood burning stoves*
The moose likes JDBC and the fly likes Compress Data using Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Compress Data using Java" Watch "Compress Data using Java" New topic
Author

Compress Data using Java

Ketul Parikh
Greenhorn

Joined: Jul 17, 2009
Posts: 14
Hi,

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??

KETUL
Ireneusz Kordal
Ranch Hand

Joined: Jun 21, 2008
Posts: 423
Look at java.util.Zip package: http://java.sun.com/j2se/1.4.2/docs/api/java/util/zip/package-summary.html
it has compression utilities.
Here is a tutorial from Sun ... ops ... now from Oracle
http://java.sun.com/developer/technicalArticles/Programming/compression/
Ulf Dittmer
Marshal

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


Ping & DNS - my free Android networking tools app
Ketul Parikh
Greenhorn

Joined: Jul 17, 2009
Posts: 14
Thankx to All..
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Compress Data using Java
 
Similar Threads
insertion of Packed decimal data into Db2 table from Java
JavaDb creating table error
Using Oracle package variables in JDBC.
How Result Set can be upadated while we insert the data programmatcally
Max Length of a session