drop Tables by table names - Android Database

Android examples for Database:Table Drop

Description

drop Tables by table names

Demo Code


//package com.java2s;

import android.database.sqlite.SQLiteDatabase;

public class Main {
    public static void dropTables(SQLiteDatabase database, String[] tables) {
        String sql = null;//from  w w w  .  j  a v  a  2  s  . com
        for (int i = 0; i < tables.length; i++) {
            sql = String.format("drop table %s", tables[i]);
            database.execSQL(sql);
        }
    }
}

Related Tutorials