Getting Started Excel POI

Maven Central JavaDoc

Setting up the environment

Add the Dependency to your build.

for Maven:

Java 8

<dependency>
    <groupId>org.simpleflatmapper</groupId>
    <artifactId>sfm-poi</artifactId>
    <version>3.14.2</version>
</dependency>

Java 6, 7

<dependency>
    <groupId>org.simpleflatmapper</groupId>
    <artifactId>sfm-poi</artifactId>
    <version>3.14.2</version>
    <classifier>jdk16</classifier>
</dependency>

Java 9/10

<dependency>
    <groupId>org.simpleflatmapper</groupId>
    <artifactId>sfm-poi</artifactId>
    <version>3.14.2</version>
    <classifier>jdk9</classifier>
</dependency>

Quick start

final SheetMapper<DbObject> sheetMapper =
        SheetMapperFactory
                .newInstance()
                .newMapper(DbObject.class);

...

    try (InputStream is = new FileInputStream("file.xls");
            Workbook workbook = new HSSFWorkbook(is)){
        sheetMapper.stream(workbook.getSheetAt(0)).forEach(System.out::println);
    }