How to convert CSV into Database Table?

来源:互联网 发布:2018初级会计职称软件 编辑:程序博客网 时间:2024/06/04 18:39

CSV file:

COL1;COL2;COL31;2.1;a2;2.2;b3;2.3;c

the first line will be the column names, the rest of the data will be the content.

1. recognize data type

2. get table columns

3. create "create table" sql

4. execute it

5.create "Insert" sql, use prepareStatement. Therefore, setXXX should be adjusted by data type.

6. execute them all