new to androidworld : database and comparsion
===

i want retrive 2 column data from database in the programme and compare the retrived data with 2 data items if they match i want to display other 3 column data on the screen. Can you guide me as i am new this android world
    
    package hope.location.google;
    
    import android.content.ContentValues;
    import android.content.Context;
    import android.database.sqlite.SQLiteDatabase;
    import android.database.sqlite.SQLiteOpenHelper;
    import android.util.Log;
    
    public class Comparegoogledata {
    	
    	// Column Names
    	public static final String KEY_ROWID = "_id";
    	public static final String KEY_LAT = "lat_value";
    	public static final String KEY_LOG = "long_value";
    	public static final String KEY_NAME = "dev_name";
    	public static final String KEY_VALUE = "dev_value";
    	public static final String KEY_LIGHT = "dev_light";
    
    	
    	// Column Indexes
    	public static final int LAT_COLUMN = 1;
    	public static final int LOG_COLUMN = 2;
    	public static final int NAME_COLUMN = 3;
    	public static final int VALUE_COLUMN = 4;
    	public static final int LIGHT_COLUMN = 5;
    		
    	// database name 
    	private static final String DATABASE_NAME = "devvalue";
    	
    	// database table name 
    	private static final String DATABASE_TABLE = "table1";
    	
    	private static final int DATABASE_VERSION = 1;
    	public static final String TAG = null;
    	
    	
    	private DbHelper ourHelper;
    	private final Context ourContext;
    	private SQLiteDatabase ourDatabase;
    	
    	private static class DbHelper extends SQLiteOpenHelper {
    
    		public DbHelper(Context context) {
    			super(context, DATABASE_NAME, null, DATABASE_VERSION );
    			// TODO Auto-generated constructor stub
    		}
    
    		@Override
    		public void onCreate(SQLiteDatabase db) {
    			// TODO Auto-generated method stub - the main database 
    			
    			String sql = String.format("create table %s" +"(%s int primary key, %s int, %s int, %s text, %s int, %s text)", KEY_LAT,
    					KEY_LOG,KEY_NAME,KEY_VALUE,KEY_LIGHT);
    			
    			Log.d(TAG, "onCreate with SQL:"+sql);
    			
    			db.execSQL(sql);
    			
    		}
    
    		@Override
    		public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
    			// TODO Auto-generated method stub
    			
    			db.execSQL("DROP TABLE IF EXISTS" + DATABASE_TABLE);
    			onCreate(db);
    			
    		}
    	
    }
    	
    	public Comparegoogledata(Context c){
    		   ourContext = c;
    	}
    	public 	 Comparegoogledata open(){
    		
    		ourHelper = new DbHelper(ourContext);
    		ourDatabase = ourHelper.getWritableDatabase();
    		return this;
    	}
    	
    	public void close() {
    		ourHelper.close();
    	}
    	
    	public long createEntry(String lat, String log, String name, String value, String light){
    		
    		ContentValues cv = new ContentValues();
    		
    		cv.put(KEY_LAT, lat);
    		cv.put(KEY_LOG, log);
    		cv.put(KEY_NAME, name);
    		cv.put(KEY_VALUE, value);
    		cv.put(KEY_LIGHT, light);
    		
    	    return ourDatabase.insert(DATABASE_TABLE, null, cv);
    	}
    
    }
    
    
    ----------
    ## 
    
    
    ----------
    
    
     ##