日期:2014-05-16 浏览次数:20406 次
package com.taobao; import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; public class DatabaseHelper extends SQLiteOpenHelper { private static final String DATABASE_NAME = "taobao"; private static final int DATABASE_VERSION = 1; DatabaseHelper(Context context) { super(context, DATABASE_NAME, null, DATABASE_VERSION); } @Override public void onCreate(SQLiteDatabase db) { // String sql = "CREATE TABLE " + TABLE_NAME + " (" + TITLE // + " text not null, " + BODY + " text not null " + ");"; String sql="create table brand (id text,url text,title text)"; String sql2="create table faver (id text,title text)"; db.execSQL(sql); db.execSQL(sql2); //db.close(); } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { } }