Execute raw query via SQLiteDatabase - Android Database

Android examples for Database:SQL Query

Description

Execute raw query via SQLiteDatabase

Demo Code


//package com.java2s;

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

public class Main {
    public static Cursor all(SQLiteDatabase db, String name) {
        return db.rawQuery("SELECT id, data FROM " + name + ";", null);
    }/*ww w . ja va 2  s.  c o m*/
}

Related Tutorials