1. 程式人生 > >SQLite資料庫增加查詢

SQLite資料庫增加查詢

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) {

}

}