大きな Excel ファイルを変更する Java アプリケーションを実行しています。そして、私は更新が行われるのに時間がかかることを経験しています..
各セルについて、休閑地としての変更に基づいて更新を実行しています
public boolean updateCellData(ColumnName, RowNum, Data){
FileInputStream fis = new FileInputStream(path);
Workbook workbook = WorkbookFactory.create(fis);
row = getRow(rowNum-1);
if (row == null){
row = sheet.createRow(rowNum-1);
}
cell = row.getCell(colNum);
if (cell == null){
cell = row.createCell(colNum);
}
cell.setCellValue(data);
fileOut = new FileOutputStream(path);
workbook.write(fileOut);
fileOut.close();
}
コードに対して実行できる最適化はありますか?