I am trying do a sign up process. Where i have a method inside the DbAdaptor where i check if the username exists.
public Boolean checkUsername(String username) throws SQLException {
Cursor mCursor = db.query(TABLE_USERS, new String[] { ID,
KEY_NAME, KEY_USERNAME}, KEY_USERNAME + "="
+ username, null, null, null, null, null);
if (mCursor != null) {
return true;
}
return false;
}
From the Edit text i sent a value “harsha” as username to test it. but i am getting the following error

http://variable3.com/files/screenshots/2010-12-26_1215.png
the code inside the activity is this
DBAdapter db = new DBAdapter(RegisterActivity.this);
db.open();
if (db.checkUsername(username))
Toast.makeText(RegisterActivity.this, "Found",
Toast.LENGTH_LONG).show();
else
Toast.makeText(RegisterActivity.this, "Not Found",
Toast.LENGTH_LONG).show();
db.close();
you need to send the harsha as ‘harsha’ with single quote