Android SqliteDatabase Command dropAllViews(SQLiteDatabase sqlitedatabase)

Here you can find the source of dropAllViews(SQLiteDatabase sqlitedatabase)

Description

drop All Views

Declaration

private static void dropAllViews(SQLiteDatabase sqlitedatabase) 

Method Source Code

//package com.java2s;

import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;

public class Main {
    private static final String MASTER_COLUMNS[] = { "name" };

    private static void dropAllViews(SQLiteDatabase sqlitedatabase) {
        Cursor cursor = null;/*  w  ww  .  j av a  2s . c o m*/
        try {
            String name = null;
            cursor = sqlitedatabase.query("sqlite_master", MASTER_COLUMNS,
                    "type='view'", null, null, null, null);
            do {
                if (!cursor.moveToNext())
                    break;
                name = cursor.getString(0);
                sqlitedatabase.execSQL((new StringBuilder(
                        "DROP VIEW IF EXISTS ")).append(name).toString());
            } while (true);
        } finally {
            if (null != cursor) {
                cursor.close();
            }
        }
    }
}

Related

  1. getTourNames(SQLiteDatabase db)
  2. insertTour(SQLiteDatabase db, String tourName)
  3. isCompanyInTour(SQLiteDatabase db, long companyId, long tourId)
  4. tourNameExists(SQLiteDatabase db, String tourName)
  5. getColumns(SQLiteDatabase db, String tableName)
  6. getRowsCount(SQLiteDatabase sqlitedatabase, String s, String s1, String as[])
  7. formatCalendarForSQLite(Calendar calendar)
  8. getCalendarFromSqlite(String dateString)
  9. execMultipleSQL(SQLiteDatabase db, ArrayList sqlStatements)