Android SqliteDatabase Command getTourNames(SQLiteDatabase db)

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

Description

get Tour Names

Declaration

public static List<String> getTourNames(SQLiteDatabase db) 

Method Source Code

//package com.java2s;
import java.util.ArrayList;
import java.util.List;

import android.database.Cursor;

import android.database.sqlite.SQLiteDatabase;

public class Main {
    protected final static String TOUR_TABLE_NAME = "Tour";
    protected final static String TOUR_NAME = "name";

    public static List<String> getTourNames(SQLiteDatabase db) {
        List<String> tourNames = new ArrayList<String>();
        Cursor cursor = db.query(true, TOUR_TABLE_NAME,
                new String[] { TOUR_NAME }, null, null, null, null, null,
                null);/* w w  w. jav  a  2  s .c o m*/
        cursor.moveToFirst();
        while (!cursor.isAfterLast()) {
            tourNames.add(cursor.getString(0));
        }
        cursor.close();
        return tourNames;
    }
}

Related

  1. updateTable(SQLiteDatabase database, String table, String id, String[] newValues)
  2. getTaskCursor(SQLiteDatabase database, String name)
  3. SQLiteSanitize(String input)
  4. getFreeTourName(SQLiteDatabase db, String tourName)
  5. getNewTourPointPosition(SQLiteDatabase db, long tourId)
  6. insertTour(SQLiteDatabase db, String tourName)
  7. isCompanyInTour(SQLiteDatabase db, long companyId, long tourId)
  8. tourNameExists(SQLiteDatabase db, String tourName)
  9. getColumns(SQLiteDatabase db, String tableName)