我有大量数据要导入到一个sqlite数据库中.
4列和150行.目前,数据位于Excel电子表格中.
如何将其导入我的Android应用程序?
String SQL = "create table " + TABLE + "( "
+ BaseColumns._ID
+ " integer primary key, "
+ Column1+ " text, "
+ Column2+ " text, "
+ Column3+ " text, "
+ Column4+ " text);";
db.execSQL(SQL);
ContentValues values = new ContentValues();
values.put(DBAdapter.Column1, "HP");
values.put(DBAdapter.Column2, "qw");
values.put(DBAdapter.Column3, "5280");
values.put(DBAdapter.Column4, "345, 546");
db.insert(DBAdapter.TABLE, null, values);
ContentValues values2 = new ContentValues();
values2.put(DBAdapter.Column1, "P");
values2.put(DBAdapter.Column2, "other");
values2.put(DBAdapter.Column3, "other");
values2.put(DBAdapter.Column4, "345");
}
这是我如何在我的数据库中插入两行,但我不想要为150执行此操作?