我用java读取一个简单的Execl文件,是成功的,但是一个复杂的Exec就不行了,错误如下:
Warning:  Shared template formula is null - trying most recent formula template
Warning:  Shared template formula is null - trying most recent formula template
Warning:  Shared template formula is null - trying most recent formula template
Warning:  Shared template formula is null - trying most recent formula template
Warning:  Shared template formula is null - trying most recent formula template
Warning:  Shared template formula is null - trying most recent formula template
Warning:  Shared template formula is null - trying most recent formula template
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
代码如下:
public static void reader(File file,String sheet,int startrow) throws Exception{
      String trans_execl_id="";
      InputStream isProduct = new FileInputStream(file);
         Workbook rwb = Workbook.getWorkbook(isProduct);
         Sheet st = rwb.getSheet(sheet);
         int excelRows = st.getRows();
         System.out.println("Total rows: " + (excelRows - startrow));
         for(int i = startrow; i < excelRows; i++){
          trans_execl_id = st.getCell(0, i).getContents();  //序号
     }
         rwb.close();
         isProduct.close();
     }