This query keeps returning errors like error near ?.
public Cursor getRow2( String st, String dr) throws SQLException {
String whereClause = "(adate ?) AND (station ?)";
String[] whereArgs = new String[] { dr, st };
String orderBy = "adate";
Cursor mCursor = db.query(DATABASE_TABLE, columns, whereClause, whereArgs,
null, null, orderBy);
String dr is for "data-range".
- If the user does specify the two dates, then
drgets a value likeBETWEEN 2004-03-01 AND 2004-06-01. - Othewise
drgetsNOT NULLso that the query finds ALL dates.
String st is for "gas station".
- If the user provides the station name,
stgets a string like'Shell'. - Otherwise
stgetsNOT NULLso as to find ALL stations.
Thank you very much.