Hi I am trying to get the values of two columns with the column name. I have uploaded an excel sheet and I have to fetch the values of this two columns and then save it in DB. Can someone help me with this
Asked
Active
Viewed 144 times
1 Answers
0
Include the latest POI jar
FileInputStream inputStream = ew FileInputStream(" Excel Path ");
Workbook workbook = new XSSFWorkbook(inputStream);
Sheet workSheet = workbook.getSheet(0); // put your sheet number
Iterator<Row> rowIterator = workSheet.iterator();
while (rowIterator.hasNext()) {
Row nextRow = rowIterator.next();
Cell cell = nextRow.getCell("col name");
String cellData = cell.getStringCellValue();}

Rahul Dasgupta
- 148
- 10