Android examples for Database:SQL Query
Open Database and execute SQL
//package com.book2s; import android.content.Context; import android.database.sqlite.SQLiteDatabase; public class Main { public static void executeSQL(Context context, String sql) { SQLiteDatabase db = context.openOrCreateDatabase("data.db", context.MODE_PRIVATE, null); System.out.println(sql);/* ww w . j a v a 2 s .c o m*/ db.execSQL(sql); db.close(); } }