Code example for SQLiteStatement

Methods: simpleQueryForLong

0
 
	public long getSize() { 
 
		String sql = "SELECT COUNT(*) FROM " + DATABASE_TABLE;
		SQLiteStatement statement = ourDatabase.compileStatement(sql);
		long count = statement.simpleQueryForLong();
		return count;
	} 
 
	public String getKEY_Numb(long l) throws SQLException {
		// TODO Auto-generated method stub 
		String[] columns = new String[] { KEY_ROWID, KEY_SETTINGS };
		Cursor c = ourDatabase.query(DATABASE_TABLE, columns, KEY_ROWID + "="
				+ l, null, null, null, null);
		if (c != null) {
			c.moveToFirst();
			String data = c.getString(1);
			c.close();
			return data;
		} 
		return null;