
Bazy danych SQLite
651
jesteś tutaj
Pełny kod pomocnika SQLite
Poniżej przedstawiliśmy kompletny kod klasy
CoffeinaDatabaseHelper
,
który dodaje do tabeli
DRINK
kolumnę
FAVORITE
(zmiany wprowadzone
w kodzie zostały wyróżnione pogrubioną czcionką):
package com.hfad.coffeina;
import android.content.ContentValues;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
class CoffeinaDatabaseHelper extends SQLiteOpenHelper {
private static final String DB_NAME = ”coffeina”; // Nazwa bazy danych
private static final int DB_VERSION = 2; // Numer wersji bazy danych
CoffeinaDatabaseHelper(Context ...