Hi!
How can I protect my queries if I like to use rawQuery method? For
example, I wrote a query
String query = "SELECT " + DbHelper.TABLE_WORDS + "." +
DbHelper.WORDS_WORD + ", " +
DbHelper.TABLE_TRANS + "." + DbHelper.TRANS_WORD +
" FROM " + DbHelper.TABLE_WORDS +
" INNER JOIN " + DbHelper.TABLE_TRANS +
" ON " + DbHelper.TABLE_WORDS + "." + DbHelper.WORDS_ID + "=" +
DbHelper.TABLE_TRANS + "." + DbHelper.TRANS_FOREIGN_ID_WORD + "
WHERE " +
DbHelper.TABLE_WORDS + "." + DbHelper.WORDS_ID + "=?";
Cursor cur = db.rawQuery(query, new String[]
{ Integer.toString(idSend) } );
I wrote it instead of
String query = "SELECT " + DbHelper.TABLE_WORDS + "." +
DbHelper.WORDS_WORD + ", " +
DbHelper.TABLE_TRANS + "." + DbHelper.TRANS_WORD +
" FROM " + DbHelper.TABLE_WORDS +
" INNER JOIN " + DbHelper.TABLE_TRANS +
" ON " + DbHelper.TABLE_WORDS + "." + DbHelper.WORDS_ID + "=" +
DbHelper.TABLE_TRANS + "." + DbHelper.TRANS_FOREIGN_ID_WORD + "
WHERE " +
DbHelper.TABLE_WORDS + "." + DbHelper.WORDS_ID + "=" + idSend;
Cursor cur = db.rawQuery(query, null);
Will using of selectionArgs parametr protect query?
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en