Time efficient program for importing an excel sheet and then storing it into DB in servlet
问题 I have written a code to import .xls and store the data into db. It works fine for small amount of data i.e some hundreds of rows of excel. But if the .xls has say 5000 rows, the importing and storing takes about 1.5 - 2 minutes. Here is the piece of code: sql = new StringBuffer("insert into bookdetails(bookno"); for (int i = 0; i < header.length; i++) sql.append("," + header[i]); sql.append(") values(?"); for (int i = 0; i < header.length; i++) sql.append(",?"); sql.append(")"); System.out