First of all I've looked up several topics on this but nothing specifically addressing this issue in Java.
I have the following method.
public String getCount() {
SQLiteDatabase db = smokinDBOpenHelper.getWritableDatabase();
String w = "Home";
Cursor cursor = db.rawQuery("select * from " + smokinDBOpenHelper.INCIDENTS_TABLE +
" where " + KEY_LOCATION + " = 'Home'", null);
int i = cursor.getCount();
String s = ("You have " + i + " entries in this column");
return s;
}
I would like this query to use the variable above it rather than a specific hard coded String "Home".
I've tried + {w} + {w%} + w and a few others, nothing seems to work