Code example for SQLiteStatement

Methods: close, simpleQueryForLong

0
 
	private int getRowsCount(SQLiteDatabase db, String table) {
		SQLiteStatement sqlCount = null;
		try { 
			sqlCount = db.compileStatement("SELECT COUNT(*) FROM " + table);
			return (int) sqlCount.simpleQueryForLong();
		} 
		finally { 
			if (sqlCount != null) {
				sqlCount.close();
			} 
		} 
	} 
 
	/** 
	 * Update a record in the database. 
	 *  
	 * @see android.content.ContentProvider#update(android.net.Uri, 
	 *      android.content.ContentValues, java.lang.String, java.lang.String[]) 
	 */ 
	@Override