SQLite数据库

public class MyHelper extends SQLiteOpenHelper {

public MyHelper(Context context) {

super(context, "mydb", null, 1);

}

@Override

public void onCreate(SQLiteDatabase sqLiteDatabase) {

//创建数据表三个字段 id url json

sqLiteDatabase.execSQL("create table dbcache(id integer primary key autoincrement,url text not null,json text not null)");

}

@Override

public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {

}

}


public class MyHelper extends SQLiteOpenHelper {

public MyHelper(Context context) {

super(context, "mydb", null, 1);

}

@Override

public void onCreate(SQLiteDatabase sqLiteDatabase) {

//创建数据表三个字段 id url json

sqLiteDatabase.execSQL("create table dbcache(id integer primary key autoincrement,url text not null,json text not null)");

}

@Override

public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {

}

}


public class MyHelper extends SQLiteOpenHelper {

public MyHelper(Context context) {

super(context, "mydb", null, 1);

}

@Override

public void onCreate(SQLiteDatabase sqLiteDatabase) {

//创建数据表三个字段 id url json

sqLiteDatabase.execSQL("create table dbcache(id integer primary key autoincrement,url text not null,json text not null)");

}

@Override

public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {

}

}

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 1.SQLite数据类型 一般数据采用的固定的静态数据类型,而SQLite采用的是动态数据类型,会根据存入值自动判...
    浪子_归心阅读 4,553评论 0 0
  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 135,497评论 19 139
  • 布局 Activity public class MainActivity extends AppCompatAc...
    Android初学者阅读 3,418评论 0 1
  • 昨天突然降温十多度,很大的风,有雨,我把车里的暖气打开了,手机蓝牙自动连接到音响,赵雷在唱《少年锦时》,雨刮和音乐...
    张红年阅读 2,206评论 1 1