Android SQLException - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android SQLException class.

This code example shows how to use the following methods:
      getContext().getContentResolver().notifyChange(uri, null);
 
      return(uri);
    } 
 
    throw new SQLException("Failed to insert row into " + url);
  } 
 
  @Override 
  public int delete(Uri url, String where, String[] whereArgs) {
    int count=db.getWritableDatabase().delete(TABLE, where, whereArgs);
 
    getContext().getContentResolver().notifyChange(url, null);
 
    return(count);
  } 
 
  @Override 
  public int update(Uri url, ContentValues values, String where,
                    String[] whereArgs) {
7
CodeRank
This code example shows how to use the following methods:
      getContext().getContentResolver().notifyChange(uri, null);
 
      return(uri);
    } 
 
    throw new SQLException("Failed to insert row into " + url);
  } 
 
  @Override 
  public int delete(Uri url, String where, String[] whereArgs) {
    int count=db.getWritableDatabase().delete(TABLE, where, whereArgs);
 
    getContext().getContentResolver().notifyChange(url, null);
 
    return(count);
  } 
 
  @Override 
  public int update(Uri url, ContentValues values, String where,
                    String[] whereArgs) {
7
CodeRank
This code example shows how to use the following methods:getMessage
		L.d(toString()); 
		int rowCount = 0;
		try { 
			rowCount = db.delete(tableName, selection.first, selection.second);
		} catch (SQLException e) {
			L.e(e.getMessage());
			L.d(e);
		} 
		return rowCount;
	} 
 
	@Override 
	public String toString() {
		return "DELETE" + super.toString() + "."; 
	} 
 
} 
7
CodeRank
This code example shows how to use the following methods:
      getContext().getContentResolver().notifyChange(uri, null);
 
      return(uri);
    } 
 
    throw new SQLException("Failed to insert row into " + url);
  } 
 
  @Override 
  public int delete(Uri url, String where, String[] whereArgs) {
    int count=db.getWritableDatabase().delete(TABLE, where, whereArgs);
 
    getContext().getContentResolver().notifyChange(url, null);
 
    return(count);
  } 
 
  @Override 
  public int update(Uri url, ContentValues values, String where,
                    String[] whereArgs) {
7
CodeRank
This code example shows how to use the following methods:getMessage
		int rowCount = 0;
		try { 
			rowCount = db.update(tableName, contentValues, selection.first,
					selection.second);
		} catch (SQLException e) {
			L.e(e.getMessage());
			L.d(e);
		} 
		return rowCount;
	} 
 
	@Override 
	public String toString() {
		return "UPDATE" + super.toString() + ", contentValues: '" 
				+ contentValues + "'.";
	} 
} 
7
CodeRank
This code example shows how to use the following methods:
		if (rowId > 0) {
			Uri noteUri = ContentUris.withAppendedId(uri, rowId);
			getContext().getContentResolver().notifyChange(noteUri, null);
			return noteUri;
		} else 
			throw new SQLException("Failed to insert row into " + uri);
	} 
 
	 
	@Override 
	public int delete(Uri uri, String selection, String[] selectionArgs) {		
		final SQLiteDatabase db = dbHelper.getWritableDatabase();
		final SelectionBuilder builder = buildSelectionFromUri(uri);
		int count = builder.where(selection, selectionArgs).delete(db);
		getContext().getContentResolver().notifyChange(uri, null);
		return count;
	} 
	 
	@Override 
	public int update(Uri uri, ContentValues values, String selection,
7
CodeRank
This code example shows how to use the following methods:
      getContext().getContentResolver().notifyChange(uri, null);
 
      return(uri);
    } 
 
    throw new SQLException("Failed to insert row into " + url);
  } 
 
  @Override 
  public int delete(Uri url, String where, String[] whereArgs) {
    int count=db.getWritableDatabase().delete(TABLE, where, whereArgs);
 
    getContext().getContentResolver().notifyChange(url, null);
 
    return(count);
  } 
 
  @Override 
  public int update(Uri url, ContentValues values, String where,
                    String[] whereArgs) {
7
CodeRank
This code example shows how to use the following methods:printStackTrace
			initialValues.put(KEY_ADDRESS, address);
			initialValues.put(KEY_PORT, port);
			initialValues.put(KEY_SSL, useSSL ? 1:0);
			db.insert(CORE_TABLE, null, initialValues);
		} catch(SQLException e) {
			e.printStackTrace();
		} 
	} 
 
 
	public void deleteCore(long rowId) {
		db.delete(CORE_TABLE, KEY_ID + "=" + rowId, null);
	} 
 
	public boolean hasCores() { 
		Cursor c = db.query(CORE_TABLE, new String[] {KEY_ID,KEY_NAME}, null, null, null, null, null);
		boolean hasCores;
		if (c != null && c.getCount()>0) {
			hasCores = true;
		}else{ 
6
CodeRank
This code example shows how to use the following methods:
      getContext().getContentResolver().notifyChange(uri, null);
 
      return(uri);
    } 
 
    throw new SQLException("Failed to insert row into " + url);
  } 
 
  @Override 
  public int delete(Uri url, String where, String[] whereArgs) {
    int count=db.getWritableDatabase().delete(TABLE, where, whereArgs);
 
    getContext().getContentResolver().notifyChange(url, null);
 
    return(count);
  } 
 
  @Override 
  public int update(Uri url, ContentValues values, String where,
                    String[] whereArgs) {
7
CodeRank
This code example shows how to use the following methods:
      getContext().getContentResolver().notifyChange(uri, null);
 
      return(uri);
    } 
 
    throw new SQLException("Failed to insert row into " + url);
  } 
 
  @Override 
  public int delete(Uri url, String where, String[] whereArgs) {
    int count=db.getWritableDatabase().delete(TABLE, where, whereArgs);
 
    getContext().getContentResolver().notifyChange(url, null);
 
    return(count);
  } 
 
  @Override 
  public int update(Uri url, ContentValues values, String where,
                    String[] whereArgs) {
7
CodeRank

Related Android SQLException Questions & Answers:

See Code Examples for Android SQLException Methods: