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