开发者

import .xls files to mysql in java servlet

I have a folder of 300+ xls files. The structure of this files is the same, but data is different. So I need to import this data to mysql table using servlets. I think there are few stages:

  1. Loa开发者_StackOverflow社区d a folder with files to server
  2. Convert files to .csv
  3. Import files one by one to mysql

But how can I implement this mechanism technically using servlets?

Thanks


First convert Xls to csv using this:

http://permalink.gmane.org/gmane.comp.jakarta.poi.user/14301

Then Import the csv using this:

http://www.javalobby.org/java/forums/t53674.html


using apache poi you can easily read any number of xls file. link :http://poi.apache.org/ To insert it into database it is not required to convert it into .csv. You can read each cell of each file .Since each file's structure is same a List of DTO formed by storing all value of you excel sheet can be directly inserted into database. You can get started at http://poi.apache.org/spreadsheet/quick-guide.html

                    Best of Luck
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜