InBlock.gifString name = "xls\\hetongdaoqitixing.xls";
InBlock.gif        File file = new File(name);
InBlock.gif        try {        
InBlock.gif          Workbook wb = Workbook.getWorkbook(file);                
InBlock.gif          WritableWorkbook book = Workbook.createWorkbook(new File("xlsd\\hetongdaoqitixing.xls")
InBlock.gif          WritableSheet sheet = book.getSheet(0);
InBlock.gif          int cols = sheet.getColumns();
InBlock.gif          DB db = new DB();            
InBlock.gif          ResultSet rs = db.getCon().createStatement().executeQuery("select * from fcb_hetong where datediff(day,getDate(),止租日期)<=30 and datediff(day,getDate(),止租日期)>=0 and 合同状态='生效合同'");
InBlock.gif          while (rs.next()) {
InBlock.gif            int rows = sheet.getRows();
InBlock.gif            for (int i = 0; i < cols; i++) {
InBlock.gif                                                    sheet.addCell(new Label(i,rows,rs.getString(i + 1).toString()));
InBlock.gif            }
InBlock.gif          }
InBlock.gif          book.write();
InBlock.gif          System.out.println("成功");
InBlock.gif          book.close();
InBlock.gif          wb.close();
InBlock.gif          Runtime run=Runtime.getRuntime();
InBlock.gif          run.exec("C:\\Program Files\\Microsoft Office\\OFFICE11\\EXCEL.EXE    xlsd\\hetongdaoqitixing.xls");
InBlock.gif        }    
InBlock.gif        catch (Exception e1) {
InBlock.gif        
InBlock.gif          e1.printStackTrace();
InBlock.gif        }
这个xls\\hetongdaoqitixing.xls这是自己建的EXCEL模版,建好之后要把导入的数据字段提前写在EXCEL中,负责导不进去!xlsd\\hetongdaoqitixing.xls这个建好以后就可以了!