select database table row By Id - Android Database

Android examples for Database:SQL Query

Description

select database table row By Id

Demo Code


//package com.book2s;

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

public class Main {
    public static Cursor selectById(SQLiteDatabase db, String tableName,
            int id) {
        return db.query(false, tableName, null, "id=" + id, null, null,
                null, null, null);//www . jav  a2  s  .c o  m
    }
}

Related Tutorials