1 package com.android.client;
2 import android.content.Context; 3 import android.database.sqlite.SQLiteDatabase; 4 import android.database.sqlite.SQLiteOpenHelper; 5 import android.database.sqlite.SQLiteDatabase.CursorFactory; 6 7 public class DatabaseHelper extends SQLiteOpenHelper{ 8 /*public static final String TB_XINLANGWEIBO="XINLANGWEIBO"; 9 public static final String TB_QQGROUP="QQGROUP"; 10 public static final String TB_WEB="WEB"; 11 public static final String TB_QQLIST="QQLIST"; 12 public static final String TB_CLIENTPUB="CLIENTPUB"; 13 14 public static final String XINLANGWEIBO_ID="_id"; 15 public static final String QQGROUP_ID="_id"; 16 public static final String WEB_ID="_id"; 17 public static final String CLIENTPUB_ID="_id"; 18 19 public static final String QQLIST_ID="_id"; 20 public static final String QQLIST_NICK="NICK";*/ 21 public static final String TB_BUSINESS="BUSINESS"; 22 23 public static final String ID="_id"; 24 public static final String class="CLASS"; 25 public static final String CONTENT="CONTENT"; 26 public static final String FROM="FRM"; 27 public static final String WHO="WHO"; 28 29 30 public DatabaseHelper(Context context,String name,CursorFactory factory,int version){ 31 super(context,name,factory,version); 32 } 33 34 @Override 35 public void onCreate(SQLiteDatabase arg0){ 36 //arg0.execSQL("CREATE TABLE IF NOT EXISTS "+TB_XINLANGWEIBO+"(_id INTEGER PRIMARY KEY AUTOINCREMENT,CONTENT TEXT);"); 37 //arg0.execSQL("CREATE TABLE IF NOT EXISTS "+TB_QQGROUP+"(_id INTEGER PRIMARY KEY AUTOINCREMENT,CONTENT TEXT);"); 38 //arg0.execSQL("CREATE TABLE IF NOT EXISTS "+TB_WEB+"(_id INTEGER PRIMARY KEY AUTOINCREMENT,CONTENT TEXT);"); 39 40 //arg0.execSQL("CREATE TABLE IF NOT EXISTS "+TB_QQLIST+"(_id TEXT PRIMARY KEY,NICK TEXT);"); 41 //arg0.execSQL("CREATE TABLE IF NOT EXISTS "+TB_CLIENTPUB+"(_id INTEGER PRIMARY KEY AUTOINCREMENT,CONTENT TEXT);"); 42 arg0.execSQL("CREATE TABLE IF NOT EXISTS "+TB_BUSINESS+"(_id INTEGER PRIMARY KEY AUTOINCREMENT,CLASS TEXT,CONTENT TEXT,FRM TEXT,WHO TEXT);"); 43 44 45 } 46 @Override 47 public void onUpgrade(SQLiteDatabase db,int oldVertion,int newVersion){ 48 //db.execSQL("DROP TABLE IF EXISTS"+TB_XINLANGWEIBO); 49 //db.execSQL("DROP TABLE IF EXISTS"+TB_QQGROUP); 50 //db.execSQL("DROP TABLE IF EXISTS"+TB_WEB); 51 //db.execSQL("DROP TABLE IF EXISTS"+TB_QQLIST); 52 onCreate(db); 53 54 } 55 }