java.lang.outofmemory exception while reading excel file (xlsx) using POI

后端 未结 7 1883
死守一世寂寞
死守一世寂寞 2020-12-19 19:34

I am developing a web application which reads data from excel file (xlsx). I am using POI for reading excel sheet. The problem is when I try to read excel file, the server t

相关标签:
7条回答
  • 2020-12-19 20:33

    I have solved the problem through change in implementation. Actually firstly I was fetching all data from Excel file and data was being stored in ArrayList type. After that I was inserting data into DB and that was the real problem. Now I am not storing data at all. As I get one record from ResultSet, I insert it into DB immediately instead of storing it into arraylist. I know this one by one insertion is not a good approach but for time being I am using this approach. In future if I find better one, I definitely switch to that one. Thanks to all.

    0 讨论(0)
提交回复
热议问题