You are actually asking two different questions:
- How to save a Map object in a database
You need to create a database and a corresponding table. You can serialize the map into a binary object in the original way and save it in the database as a BLOB. However, it would be better to have a table entry for each feature on the map. To communicate with the database you need to use the JDBC API .
- How to compress Mao to make less hard disk space?
You need to serialize the map to a file. The map will be saved in a binary file that you can try compress .
source
share