SQLite資料庫增加查詢
阿新 • • 發佈:2018-12-11
package liziqiang.bawei.com.lziqiang20180921;
import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper;
public class DBHelpers extends SQLiteOpenHelper{ public DBHelpers(Context context, String name, SQLiteDatabase.CursorFactory factory, int version) { super(context, name, factory, version); }
@Override
public void onCreate(SQLiteDatabase sqLiteDatabase) {
sqLiteDatabase.execSQL("CREATE TABLE news(id integer PRIMARY key autoincrement,data text)");
}
@Override
public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {
}
}