The documentation for SQLiteDatabase.query says that the selectionArgs will be bound as strings.
What is the recommended way to perform a query with an integer parameter?
Is it this:
int value = 10;
Cursor cursor = database.query(
"TABLE_X",
new String[] { "COLUMN_A", "COLUMN_B" },
"COLUMN_C = " + value,
null,
null,
null,
null);
Or is it this:
int value = 10;
Cursor cursor = database.query(
"TABLE_X",
new String[] { "COLUMN_A", "COLUMN_B" },
"COLUMN_C = ?",
new String[] { Integer.toString(value) },
null,
null,
null);
Or something else?