// DbConn conn = new DbConn(MainActivity.this,"hellodb",null,1);
// conn.createtable("worldtb");
package com.oschina.osmf; import androID.content.Context; import androID.database.sqlite.sqliteDatabase; import androID.database.sqlite.sqliteDatabase.CursorFactory; import androID.database.sqlite.sqliteOpenHelper; import androID.util.Log; public class DbConn extends sqliteOpenHelper{ public DbConn(Context context,String name,CursorFactory factory,int version) { super(context,name,factory,version); } @OverrIDe public voID onCreate(sqliteDatabase db) { } @OverrIDe public voID onUpgrade(sqliteDatabase db,int oldVersion,int newVersion) { } public voID createtable(String tablename) { sqliteDatabase db = this.getWritableDatabase(); String sql = "create table if not exists "+tablename+"(ID integer primary key,name varchar)"; db.execsql(sql); Log.i("test","创建表成功"); } public voID selecttable(String tablename) { } }
总结以上是内存溢出为你收集整理的sqlite 个人写增删改查实例全部内容,希望文章能够帮你解决sqlite 个人写增删改查实例所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)