I have an excel file with one or two sheets and 30K+ rows in each sheet. I need to parse each row into a DTO, then generate a unique number for each of them and then store everything in DB.
I can convert data to DTOs in 2 ways:
- Either, read data directly from excel using Apache.poi,
- Or, import data into DB (using DB Tools) and read from DB (by creating appropriate entity and then converting it to DTO).
My questions is: which option is preferable/optimal/faster/better?
My concern is that reading from excel would be slower but each row could have about 100 cells so creating the appropriate table and entity class with those fields may also take time considering that the functionality may be executed very seldom.