Reputation: 4838
I'm working on Android platform with Java and SQLite. I know SQL and jdbc fundamentals and i want, for performance reasons, to use a prepared statement to extract data from DB. For INSERT/UPDATE/DELETE operations i have already used SQLiteStatement.
Is there a way to use prepared statement for SELECT operation with standard SQLite interface offered by Android SDK?
Upvotes: 0
Views: 791
Reputation: 180060
SQLiteDatabase and SQLiteQueryBuilder always create a temporary statement.
SQLiteStatement works only for queries that return a single value.
The Android database API does not have any mechanism to create a prepared statement for a query.
(Compiling a statement is extremely fast in SQLite, but that cannot be the reason because prepared statements are supported for other statement types.)
Upvotes: 1