Вопрос

Does this construction prevent SQL-injection?

ContentValues localContentValues = new ContentValues();
localContentValues.put("some_column", StringFromUser);
localSQLiteDatabase.update("some_table", localContentValues, null, null);
Это было полезно?

Решение

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

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top