Reputation: 822
Which method is better for inserting a record to SQLite database in Android? and why?
SQLiteDatabase.insert(String table, String nullColumnHack, ContentValues values)
or
SQLiteStatement.excuteinsert()
What is the fundamental difference between these two regardless of the syntax usage pattern?
Upvotes: 1
Views: 488
Reputation: 180270
SQLiteStatement
allows you to prepare a statement once and to execute it repeatedly.
This might be more efficient when inserting many rows, but is usually not the bottleneck on mobile devices.
Upvotes: 1