Sameek Mishra
Sameek Mishra

Reputation: 9384

how to read number of record in xlsx file using Apache POI?

I have requirement to read *.xlsx file in java for that i am using Apache POI API.if number of row are less it's work nicely but when number of row are greater then or equals 65536. i got an exception java.lang.OutOfMemoryError: Java heap space.please help me how i am able to solve that problem.

thanks sameek

Upvotes: 1

Views: 1298

Answers (3)

Gagravarr
Gagravarr

Reputation: 48326

POI supports a low memory way to read .xlsx files in a streaming way. See http://poi.apache.org/spreadsheet/how-to.html#xssf_sax_api for details on how it works, and how to get started.

Upvotes: 1

user710818
user710818

Reputation: 24248

If it possible for you save xslx file as xml - you can use SAX which is very quick and hasn't limitation about number of rows.

Upvotes: 1

Related Questions