标签:
public class CoolWeatherOpenHelper extends SQLiteOpenHelper {
/**
* Province表建表语句
*/
public static final String CREATE_PROVINCE="create table Province("
+"id integer primary key autoincrement,"
+"city_name text,"
+"province_id integer)";
//构造方法 四个参数: context, name, factory,version
public CoolWeatherOpenHelper(Context context, String name, CursorFactory factory, int version){
super(context,name,factory,version);
@override
public void onCreate(SQLiteDatebase db){
db.execSQL(CREATE_PROVINCE);//创建Province表
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion,int newVersion){
super(context,name,factory,version);}
}
标签:
原文地址:http://www.cnblogs.com/gentspy/p/5442794.html