I am trying to write a small spring boot application, which needs to do the following: --Create and Save: -Query things from database (List of result sets, to be converted to pojo) -Convert that pojo to csv (without the actual file) -Save that csv to database as blob/bytea (postgres).
--Retrieve: -Get the bytea from db, send that as part of json response from a GET endpoint
I have managed to create the csv via OpenCSV and using StatefulBeanToCsv - but since this uses Printwriter, I am worried about having memory issues when processing large files.
Any alternatives so I can do above requirements?