user3292885
user3292885

Reputation: 73

Content Values and SQL injection

Does this construction prevent SQL-injection?

ContentValues localContentValues = new ContentValues();
localContentValues.put("some_column", StringFromUser);
localSQLiteDatabase.update("some_table", localContentValues, null, null);

Upvotes: 3

Views: 1063

Answers (1)

laalto
laalto

Reputation: 152817

Using ContentValues uses variable binding behind the scenes. So yes, it's not vulnerable to the usual SQL injections.

Upvotes: 3

Related Questions