当你执行SQLite 时, SQLite 内部是编译执行的。
当循环插入多条数据时,可以使用complieStatement 让语句在循环外只编译一次
<span style="white-space:pre"> </span>String[] sCheeseNames = {"a","b","a","b","a","b","a","b"};
String[] sCheeseOrigins = {"aa","bb","aa","bb","aa","bb","aa","bb"};
SQLiteDatabase db = SQLiteDatabase.create(null);
SQLiteStatement stmt = db.compileStatement("INSERT INTO cheese VALUES(?,?)");
int i = 0;
for (Str......
阅读全文