Here you can find the source of executeSqlStatementsInTx(SQLiteDatabase db, String[] statements)
public static int executeSqlStatementsInTx(SQLiteDatabase db, String[] statements)
//package com.java2s; //License from project: Open Source License import android.database.sqlite.*; public class Main { public static int executeSqlStatementsInTx(SQLiteDatabase db, String[] statements) { db.beginTransaction();/*from ww w .j a v a 2 s . c o m*/ try { int count = executeSqlStatements(db, statements); db.setTransactionSuccessful(); return count; } finally { db.endTransaction(); } } public static int executeSqlStatements(SQLiteDatabase db, String[] statements) { int count = 0; for (String line : statements) { line = line.trim(); if (line.length() > 0) { db.execSQL(line); count++; } } return count; } }