I am able to fetch the values from an excel sheet, I have 20 columns in my sheet where 7th and 8th columns are date type cells like 7-Mar-2015, I am able to fetch the string/text values properly but not able to fetch the date format cells, and getting an error, I tried changing the type to get the cell values but not happening, can anyone help me how can I get both text/String OR Date format cells in my while loop,'
My code is as follows,
while (iterator.hasNext()) {
Row nextRow = iterator.next();
Map<Field, String> values = new EnumMap(Field.class);
for (Field f : Field.values()) {
Cell cell = nextRow.getCell(f.ordinal());
if (cell != null) {
values.put(f, cell.getStringCellValue());
}
}
The date format is 7-Mar-2015