There is also the Java POI classes (Poor Obfuscation Implementation)
for importing and exporting doc and docx, HSSF (Horrible SpreadSheet
Format) for exporting and importing xls and xlsx,
http://poi.apache.org/
There are also implementations for Outlook, Powerpoint and Visio.
Java can be integrated with PostgreSQL using the JDBC drivers:
http://jdbc.postgresql.org/
Hope this helps.