zfranciscus
zfranciscus

Reputation: 17085

Importing Excel Data into Database with Spring Framework

I am developing a website that stores data in a mysql database. One of the user of the website wishes to record data for the website in an excel spreadsheet. I intend to develop a solution that consist of three parts:

  1. A controller class that saves the uploaded excel spreadsheet into a directory in the server.
  2. A service layer that read the saved excel spreadsheet from the directory using apache POI. 3. JPA to record data in the excel spreadsheet into the mysql database.

Is this a good pattern for the intended solution ? Has anyone implemented a similar solution ?

Upvotes: 0

Views: 3058

Answers (1)

Solubris
Solubris

Reputation: 3763

Sounds reasonable.

  • See if the user would upload a csv file instead of xls file, as this will be easier to handle.
  • try to stream upload directly to disk. If you store it in memory, then large uploads will cause out of memory error for jvm.

Upvotes: 1

Related Questions