Apache POI

Apache POI is basically an API, a collection of different java libraries(classes and interfaces) which is provided by Apache foundation. With the help of this libraries, we can read, write and manipulate different Microsoft files such as excel files and word files. Here in this tutorial we will learn about the below points:
1. Apache POI maven dependency
2. Classes and interfaces in Apache POI
3. Read data from excel file
4. Write data on excel file

1. Apache POI maven dependency
If we are using maven project, we can easily add maven pom dependency.
Once we add dependency in pom.xml file, all the required jar files added in referenced libraries inside the project.

org.apache.poi
poi
3.9

Apart of this we can also download the Apache POI jar file from http://poi.apache.org/download.html and add all the downloaded files in class path.

2. Classes and interfaces in Apache POI
Once we download the JAR file we can observe that the following list of Java interfaces and classes comes in POI for reading and writing operations on excel files.
Workbook: This is an interface. The classes XSSFWorkbook and HSSFWorkbook implement this interface.
XSSFWorkbook: This is a class representation of xlsx file.
HSSFWorkbook: This is a class representation of xls file.
Sheet: This is an interface. The classes XSSFSheet and HSSFSheet implement this interface.
XSSFSheet: This is a class representing a sheet in an xlsx file.
HSSFSheet: This is a class representing a sheet in an xls file.
Row: This is an interface. The classes XSSFRow and HSSFRow implement this interface.
XSSFRow: This is a class representing a row in the sheet of xlsx file.
HSSFRow: This is a class representing a row in the sheet of xls file.
Cell: This is an interace. The classes XSSFCell and HSSFCell implement this interface.
XSSFCell: This is a class representing a cell in a row of xlsx file.
HSSFCell: This is a class representing a cell in a row of xls file.

3. Read data from excel file

4. Write data on excel file