Android SqliteDatabase Command executeSqlStatements(SQLiteDatabase db, String[] statements)

Here you can find the source of executeSqlStatements(SQLiteDatabase db, String[] statements)

Description

execute Sql Statements

License

Open Source License

Declaration

public static int executeSqlStatements(SQLiteDatabase db,
            String[] statements) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import android.database.sqlite.*;

public class Main {
    public static int executeSqlStatements(SQLiteDatabase db,
            String[] statements) {
        int count = 0;
        for (String line : statements) {
            line = line.trim();//  w  w  w  .  j av  a  2 s  .  c  o m
            if (line.length() > 0) {
                db.execSQL(line);
                count++;
            }
        }
        return count;
    }
}

Related

  1. executeSqlStatementsInTx(SQLiteDatabase db, String[] statements)
  2. getListOfDays(SQLiteDatabase db)
  3. insertIntoTable(SQLiteDatabase database, String table, String[] data)
  4. selectFromTable(SQLiteDatabase db, String table, String sample)