How do I check if a "name" value exists in a SQLLite Database? <p>I have a SQLLite Database of sites with a name field. I have save and create buttons. I want to run my addRecord() or updateRecord() depending on whether or not the value in the name field exists. </p> <p>I have this method in my DBAdapter:</p> <pre><code>public Cursor getRow(long rowId) { String where = KEY_ROWID + "=" + rowId; Cursor c = db.query(true, DATABASE_TABLE, ALL_KEYS, where, null, null, null, null, null); if (c != null) { c.moveToFirst(); } return c; } </code></pre> <p>How can I create a similar method to get the rowID based on the name String supplied?</p> <p>ie</p> <pre><code>public Cursor getRowID(String _name) { ... } </code></pre>