Java - 读取文件夹中的多个Excel文件

时间:2018-02-24 00:55:08

标签: java mysql excel apache-poi

我想读取多个文件并将它们存储到数据库中。这是我的代码,只读取一个文件。如何让它不止一个?

private static final String FILE_NAME = "C:/User/myFile.xlsx";

public static void main(String[] args) throws SQLException {

    try { 

        FileInputStream excelFile = new FileInputStream(new File(FILE_NAME));
        Workbook workbook = new XSSFWorkbook(excelFile);

        Sheet datatypeSheet = workbook.getSheetAt(0);
        Iterator<Row> iterator = datatypeSheet.iterator();
 }
}

0 个答案:

没有答案