开发者

Java and programmatically importing a csv into an SQLite3 table

开发者 https://www.devze.com 2023-04-05 00:41 出处:网络
In Java how do I programmatic开发者_StackOverflow中文版ally 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

In Java how do I programmatic开发者_StackOverflow中文版ally 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?


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

0

精彩评论

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

关注公众号