I am parsing data from an excel file and adding it to my data base using HSSFCell to parse the Excel file, I am using the following code to read the file
public void printCellDataToConsole(Vector dataHolder) throws SQLException {
// this is for the rows in the file, set to one to skip the headings
List<String> studentInformation = new ArrayList<>();
for (int i = 1; i < dataHolder.size(); i++) {
Vector cellStoreVector = (Vector) dataHolder.elementAt(i);
// this is for the colums in the table
for (int j = 0; j < cellStoreVector.size(); j++) {
HSSFCell myCell = (HSSFCell) cellStoreVector.elementAt(j);
String stringCellValue = myCell.toString();
System.out.print(stringCellValue + "\t");
}
connectToDatabase.ammendTableInDatabase("INSERT INTO Student VALUES (" + cellStoreVector.get(0) + ",'" + cellStoreVector.get(1) + "','" + cellStoreVector.get(2) + "','" + cellStoreVector.get(3) + "','" + cellStoreVector.get(4) + "'," + cellStoreVector.get(5) + ",'" + cellStoreVector.get(6) + "')");
System.out.println();
}
}
Everything is working but when i try to read any value like the following
111223361
111223362
111223364
111223363
111223366
It reads them as the following
1.11223361E8
1.11223362E8
1.11223364E8
1.11223363E8
1.11223366E8
Why is this happening and how do i solve it?
poi-3.8-20120326.jarto parse the excel files, do you want to know anything else?