Code example for SQLiteDatabase

Methods: query

0
    /** 
     * Returns a cursor that can be used to read all the rows and columns of 
     * the "purchased items" table. 
     */ 
    public Cursor queryAllPurchasedItems() {
        return mDb.query(PURCHASED_ITEMS_TABLE_NAME, PURCHASED_COLUMNS, null,
                null, null, null, null); 
    } 
 
    /** 
     * This is a standard helper class for constructing the database. 
     */ 
    private class DatabaseHelper extends SQLiteOpenHelper {
        public DatabaseHelper(Context context) {
            super(context, DATABASE_NAME, null, DATABASE_VERSION);
        } 
 
        @Override 
        public void onCreate(SQLiteDatabase db) {
            createPurchaseTable(db);