0

i want to read large excel file(which is in .xls format) which consists of more that 50K records, and insert that data into the database.

i have tried using Apache POI, but i am getting the following exception.

java.lang.OutOfMemoryError: Java heap space

i have fixed this problem by increasing heap size, but i need the solution without increasing the heap size.

i came to know that there is a solution with POI event model.

can anyone help me regarding this issue, thanks in advance.

Johnny000
  • 2,099
  • 5
  • 30
  • 58
Suresh Jaladi
  • 101
  • 2
  • 7
  • 1
    What about your POI event model code is "not working"? Please post your relevant code and describe what's wrong: Wrong output? Error messages? Exception stack traces? – rgettman Jan 06 '14 at 18:09
  • 1
    An Excel file **has** to read into memory completely. If your file is big, the only solution *is* to increase the heap size. Why can't you do that? – a_horse_with_no_name Jan 06 '14 at 18:40
  • http://stackoverflow.com/questions/11891851/how-to-load-a-large-xlsx-file-with-apache-poi – Luca Basso Ricci Feb 20 '14 at 14:00
  • In case of large file, its need huge space. Heap don't have enough space to open file. please try with sax reader it will read file with chunk of data. https://github.com/nagirrab/xls2csv/blob/master/XlsToCsv.java – Sachin Nagode Dec 21 '18 at 09:49

0 Answers0