I wanted to insert data into my SQLite database. It consists of 3 columns: name, family, id.
This is my method:
private void FillColleagueTable(){
SQLiteDatabase db = this.getWritableDatabase();
ContentValues values = new ContentValues();
values.put(KEY_NAME, "mack");
values.put(KEY_FAMILY, " jasone");
// Inserting Row
db.insert(TABLE_COLLEAGUE, null, values);
//db.close(); // Closing database connection
}
I want to add lots of rows to my table, I think this method is not the best way, is there any way to use something like query in my database handler to reduce the line of my code?any help would be appreciated.