有热心帮助的加个QQ细说我的QQ113055175,谢谢

解决方案 »

  1.   


    public List<String[]> parse(File file) {
    List<String[]> excelValueList = new ArrayList<String[]>();
    if (file.exists() && file.canRead()
    && (file.getName().lastIndexOf(".xls") >= 1)) {
    Workbook workbook = null;
    try {
    workbook = Workbook.getWorkbook(file);
    Sheet sheet = workbook.getSheet(0);
    int row = sheet.getRows();
    int col = sheet.getColumns();
    for (int r = 0; r < row; r++) {
    String[] rowValue = new String[col];
    for (int c = 0; c < col; c++) {
    rowValue[c] = sheet.getCell(c, r).getContents() != null ? sheet
    .getCell(c, r).getContents()
    : "";
    }
    excelValueList.add(rowValue);
    }
    } catch (BiffException e) {
    e.printStackTrace();
    } catch (IOException e) {
    e.printStackTrace();
    } finally {
    if (workbook != null) {
    workbook.close();
    }
    }
    }
    return excelValueList;
    }上面代码可以传一个execl文件,解析为List<String[]>集合,然后怎么入库就不用说了哈
    得引用一个jar包,叫:jxl.jar 网上可以搜索到
      

  2.   

    你是要把Excel中的数据存入数据库?我只知道用apache poi来操作Excel文档。
    楼主说EXCEL表格存入数据库问题?是什么问题。具体点。
      

  3.   

    excel存数据库excel自己就带着个功能的啊