【发布时间】:2013-03-15 04:50:49
【问题描述】:
我在为批量数据(超过 50 万条记录)生成 Excel 文件时收到SocketConnectionException。
我的 Web 应用程序的代码写入 `outputstream.这是一段sn-p代码:
while (sr.next()) {
counter++; //advance counter
view = (DataClass) sr.get(0);
try {
//writing fields values for Activity Report file
reportService.writeExcelFieldsValue(rowCounter,sheet,view,user,exportedFields);
rowCounter++;
} catch (Exception e) {
throw new RuntimeException(e);
}
if (counter == chunkSize || sr.isLast()) {
counter = 0; //reset counter
//Clear the session after a chunk and before next chunk
getSession().clear();
}
}
wb.write(bos);
bos.flush();
【问题讨论】:
标签: java web apache-poi