create table for cache via SQLiteDatabase - Android Database

Android examples for Database:SQL Query

Description

create table for cache via SQLiteDatabase

Demo Code


//package com.book2s;

import android.database.sqlite.SQLiteDatabase;

public class Main {
    static final String TABLE_NAME = "cache_data";

    static void create(SQLiteDatabase db) {
        db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME);
        db.execSQL("CREATE TABLE [cache_data] ( " + " [set_name] TEXT,  "
                + " [value] TEXT,  " + " [tag] TEXT);");
    }/*w ww . ja  v  a  2  s  . com*/
}

Related Tutorials