Loading…
Notes
Maven dependencies
Only poi-ooxml and poi actually matter — everything else in pom.xml (XML Beans, Commons Compress, TestNG, JUnit) is transitive plumbing or test-scope.
Close workbooks, always
Wrap usage in try/finally (or try-with-resources) and call close(). POI holds the file handle open until you do, and a long test run will leak descriptors otherwise.
Large files need SXSSFWorkbook
The default XSSFWorkbook holds the whole sheet in memory. Past a few tens of thousands of rows, switch to SXSSFWorkbook, which streams rows to disk instead of risking an OutOfMemoryError.
Dates need DateUtil
A numeric cell that's actually a date won't look like one unless you check DateUtil.isCellDateFormatted(cell) first — otherwise you get a raw serial number instead of a real date.