Android SqliteDatabase Command tourNameExists(SQLiteDatabase db, String tourName)

Here you can find the source of tourNameExists(SQLiteDatabase db, String tourName)

Description

tour Name Exists

Declaration

public static boolean tourNameExists(SQLiteDatabase db, String tourName) 

Method Source Code

//package com.java2s;

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 boolean tourNameExists(SQLiteDatabase db, String tourName) {
        Cursor cursor = db.query(TOUR_TABLE_NAME,
                new String[] { TOUR_NAME }, TOUR_NAME + "=?",
                new String[] { tourName }, null, null, null);
        cursor.moveToFirst();//from  w  w w .j  a  v  a  2s .  co m
        if (cursor.getCount() == 0)
            return false;
        else
            return true;
    }
}

Related

  1. getFreeTourName(SQLiteDatabase db, String tourName)
  2. getNewTourPointPosition(SQLiteDatabase db, long tourId)
  3. getTourNames(SQLiteDatabase db)
  4. insertTour(SQLiteDatabase db, String tourName)
  5. isCompanyInTour(SQLiteDatabase db, long companyId, long tourId)
  6. getColumns(SQLiteDatabase db, String tableName)
  7. dropAllViews(SQLiteDatabase sqlitedatabase)
  8. getRowsCount(SQLiteDatabase sqlitedatabase, String s, String s1, String as[])
  9. formatCalendarForSQLite(Calendar calendar)