I have to read the headers of the file in order to create a table in a database with the name of the columns specified on the CSV file.
For instance:
the program has to create a table on the database like this:
create table csv_ejemplo (
unit varchar(255),
line varchar(255),
total_time varchar(255),
ocurrences varchar(255),
text varchar(255)
);
Finally, I have to iterate over every column and insert that value into the recently created table.
How could I do this? Should I use reflection? I'm confused because I don't know if the database must be created first outside Java (I mean, through SQLite).
I would appreciate any help.