Ken
Ken

Reputation: 31161

Java and programmatically importing a csv into an SQLite3 table

In Java how do I programmatically import a csv text file into a table of an SQLite3 database? Can this even be done with SQLite3's .import, for example IMPORT myFile myTable?

Upvotes: 0

Views: 871

Answers (1)

Kris
Kris

Reputation: 5792

I guess you cannot execute the 'import' statement through JDBC, what you can do is to either use command line through Runtime.exec or just parse a .csv file within your application, create your sql commands dynamically for each csv line and execute them with JDBC execute().

Upvotes: 1

Related Questions