Here you can find the source of execMultipleSQL(SQLiteDatabase db, ArrayList
Parameter | Description |
---|---|
db | The database on which to execute the statements. |
sqlStatements | An array of SQL statements to execute. |
public static void execMultipleSQL(SQLiteDatabase db, ArrayList<String> sqlStatements)
//package com.java2s; import java.util.ArrayList; import android.database.sqlite.SQLiteDatabase; public class Main { /**//from w ww.j ava 2 s. co m * Execute all of the SQL statements in the ArrayList<String>. * * @param db * The database on which to execute the statements. * @param sqlStatements * An array of SQL statements to execute. */ public static void execMultipleSQL(SQLiteDatabase db, ArrayList<String> sqlStatements) { for (String statement : sqlStatements) { if (statement.trim().length() > 0) { db.execSQL(statement); } } } }