我正在解析 Excel 文件中的数据并将其添加到我的数据库中HSSFCell
,用于解析 Excel 文件,我正在使用以下代码读取文件
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();
}
}
一切正常,但是当我尝试读取如下任何值时
111223361
111223362
111223364
111223363
111223366
它读取它们如下
1.11223361E8
1.11223362E8
1.11223364E8
1.11223363E8
1.11223366E8
为什么会发生这种情况,我该如何解决?