我開始學習Java並需要一些幫助。我需要將CSV文件導入SQLite數據庫。我有這個CSV閱讀器,但我不知道如何將這些數據複製到SQLite數據庫。將CSV導入Java中的SQLite
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
public class csv {
public static void main(String[] args) {
String csvFile = "/home/user/user.csv";
BufferedReader br = null;
String line = "";
String cvsSplitBy = ",";
try {
br = new BufferedReader(new FileReader(csvFile));
while ((line = br.readLine()) != null) {
String[] table = line.split(cvsSplitBy);
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
if (br != null) {
try {
br.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
}
[這裏](http://stackoverflow.com/questions/25845643/insert-string-into-jdbc-sqlite-database):如何打開一個連接到SQLite數據庫並插入記錄。 – BackSlash