I have Java Map (out of Strings and Ints) objects that I want to save to a database.
Is there a standard way to go about this task?
Is there a way to compress the Map to take less space on the harddrive?
I have Java Map (out of Strings and Ints) objects that I want to
Share
You actually ask two different questions:
You need to create a database and an appropriate table. You can of source serialize the Map into a binary object and store that in the database as a BLOB. It will be better however to have a table entry for every object in the map. You need to use the JDBC API to communicate with the database.
You need to serialize the Map to a file. The map will be saved in a binary file, which you can try to compress.