有没有办法可以在应用程序中读取存储在扩展名为.sql的文件中的数据
答案 0 :(得分:0)
我假设您要做的是将SQL文件复制为默认的sqlite DB?
正如here所述。
if(Preferences.get("firstTime", true)) {
Preferences.set("firstTime", false);
String p = Display.getInstance().getDatabasePath("myDb.SQL");
Util.copy(Display.getInstance().getResourceAsStream(getClass(), "/localDb.sql"), FileSystemStorage.getInstance().openOutputStream(p));
}
// now use the DB as usual