Android数据库使用指南(下)
前言 上面已经说了,对表进行修改,其实就是对数据库进行升级,删除表也算升级啊,反正就是发生变化,数据库就需要升级。 所以老实说其实有个地方决定了数据库的版本 public class DBHelper extends SQLiteOpenHelper { public static final String db_name = "test.db"; public DBHelper(Context context, int version) { super(context, db_name, null, version); } @Override public void onCreate(SQLiteDatabase db) { db.execSQL("create table table1 (" + " _byte byte," + " _long long," + " _text text," + " _short short," + " _int int," + " _float float," + " _double double," + " _boolean boolean," + " _blob blob" + ")"); } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int