微科社区,轻松开发从此开始! 请登陆 免费注册

微科社区

当前位置:首页 > Java平台 > J2ME >

关于用jxl来操作excel文档进行数据插入内存溢出问

时间:2017-01-16 03:31  浏览:努力统计中...
Java code import jxl. * ; import jxl.write.Label; import jxl.write.Number; import jxl.write.WritableCell; import jxl.write.WritableSheet; import jxl.write.WritableWorkbook; import java.io. * ; public class UpdateExcel { public static void m
Java code
import jxl.*;import jxl.write.Label;import jxl.write.Number;import jxl.write.WritableCell;import jxl.write.WritableSheet;import jxl.write.WritableWorkbook;import java.io.*;public class UpdateExcel { public static void main(String[] args) { try { Workbook wb1 = Workbook.getWorkbook(new File("F:\\a.xls")); WritableWorkbook wwb1 = Workbook.createWorkbook(new File("F:\\a.xls"), wb1); Workbook wb2 = Workbook.getWorkbook(new File("F:\\b.xls")); WritableSheet sheet1 = wwb1.getSheet(0); Sheet sheet2 = wb2.getSheet(0); String id2 = "123"; String id1 = "456"; int count = 0; double number = 0; String song = "s"; String il = "l"; for(int i=1;i<sheet1.getRows();i++){ id1 =
顶一下
(0)
0%
踩一下
(0)
0%
------分隔线------