android - Use variable in SQLite Query -


Firstly I have seen many topics on this, but this issue has not been specifically addressed in Java

I have the following method

  public string getCount () {SQLiteDatabase db = smokinDBOpenHelper.getWritableDatabase () .; String w = "home"; Cursor = db.rawkey cursor (select from "select" + smokinDBOpenHelper.INCIDENTS_TABLE + "where" + KEY_LOCATION + '=' Home '", tap); Int i = cursor.getCount (); String S = (" Your "+++" has the entries in this column;); return s;}   

Let me place it above a specific hard-coded string "home" To use the variable should be query .

I have tried + {w} + {w%} + w and some other, anything seems to work *

Efforts to

  cursor = db.rawQuery (select "where" + SmokinDBOpenHelper.INCIDENTS_TABLE + "" + KEY_LOCATION + "= '" + w + "' ', NULL);    

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -