Android SqliteDatabase Command getListOfDays(SQLiteDatabase db)

Here you can find the source of getListOfDays(SQLiteDatabase db)

Description

get List Of Days

Declaration

public static ArrayList<String> getListOfDays(SQLiteDatabase db) 

Method Source Code

//package com.java2s;

import android.database.Cursor;

import android.database.sqlite.SQLiteDatabase;
import java.util.ArrayList;

public class Main {
    public final static String NESTLE_TABLE_NAME = "Nescafe";
    public final static String NESTLE_COLUMN_1 = "date";

    public static ArrayList<String> getListOfDays(SQLiteDatabase db) {
        Cursor cursor = db.query(true, NESTLE_TABLE_NAME,
                new String[] { NESTLE_COLUMN_1 }, null, null, null, null,
                null, null);//from   w  w  w  . j  a v  a2  s.c o m
        ArrayList<String> list = new ArrayList<String>();
        while (cursor.moveToNext())
            list.add(cursor.getString(cursor
                    .getColumnIndex(NESTLE_COLUMN_1)));
        return list;
    }
}

Related

  1. executeSqlStatements(SQLiteDatabase db, String[] statements)
  2. executeSqlStatementsInTx(SQLiteDatabase db, String[] statements)
  3. insertIntoTable(SQLiteDatabase database, String table, String[] data)
  4. selectFromTable(SQLiteDatabase db, String table, String sample)
  5. updateTable(SQLiteDatabase database, String table, String id, String[] newValues)
  6. getTaskCursor(SQLiteDatabase database, String name)