0

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?

1 Answer 1

1

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().

Sign up to request clarification or add additional context in comments.

2 Comments

A prepared statement will be faster when dealing with many inserts.
yes, it's not the point here, either way you create an sql command dynamically.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.