Read Excel File
Read Excel File
utilities;
import java.io.FileInputStream;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
public static String getCellValue(String fileName, String sheetName, int rowNo, int
cellNo/*column no.*/)
try
excelSheet = workBook.getSheet(sheetName);
cell = workBook.getSheet(sheetName).getRow(rowNo).getCell(cellNo);
workBook.close();
return cell.getStringCellValue();
catch (Exception e)
return "";
try
workBook.close();
return ttlRows;
catch (Exception e)
return 0;
try
{
FileInputStream inputStream = new FileInputStream(fileName);
workBook.close();
return ttlCells;
catch (Exception e)
return 0;