aliry
aliry

Reputation: 822

Android SQLiteDatabase.insert vs SQLiteStatement.excuteinsert

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: 487

Answers (1)

CL.
CL.

Reputation: 180010

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

Related Questions