java poi 导出excel 速度慢_java poi 生成Excel 速度非常慢,求优化方案?数据才到2000左右的时候就开始变慢了。。...

while(rs.next()){HSSFCellStylecellStyle=wb.createCellStyle();HSSFDataFormatformat=wb.createDataFormat();cellStyle.setDataFormat(format.getFormat("@"));HSSFRowrow=sheet.cr...

while(rs.next()){

HSSFCellStyle cellStyle = wb.createCellStyle();

HSSFDataFormat format = wb.createDataFormat();

cellStyle.setDataFormat(format.getFormat("@"));

HSSFRow row = sheet.createRow(i+2);

HSSFCell policyNoCell = row.createCell((short) 0);

policyNoCell.setCellStyle(cellStyle);

policyNoCell.setCellValue(new HSSFRichTextString(rs.getString(3)));

row.createCell((short) 0).setCellValue(new HSSFRichTextString(rs.getString(1)));

row.createCell((short) 1).setCellValue(new HSSFRichTextString(rs.getString(2)));

row.createCell((short) 2).setCellValue(new HSSFRichTextString(rs.getString(3)));

row.createCell((short) 3).setCellValue(new HSSFRichTextString(rs.getString(4)));

row.createCell((short) 4).setCellValue(new HSSFRichTextString(rs.getString(5)));

row.createCell((short) 5).setCellValue(new HSSFRichTextString(rs.getString(6)));

row.createCell((short) 6).setCellValue(new HSSFRichTextString(rs.getString(7)));

row.createCell((short) 7).setCellValue(new HSSFRichTextString(rs.getString(8).substring(0,9)));

row.createCell((short) 8).setCellValue(new HSSFRichTextString(rs.getString(9).substring(0,9)));

ExcelWrite.autoSetWidth(sheet,i);

i++;

}

展开

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值