Save image path name from sdcard to Sqlite database
<p>am having a little trouble here. i am trying to store and retrieve images from an sqlitedatabase by storing their image path name. the images are stored in the sdcard. I tried this code, but its not working.</p>

<p>saving image path:</p>

<pre><code> String filename = "/sdcard/barn.jpg"

ContentValues vals2 = new ContentValues(); //create content values and store it.
   vals.put(ImageDB.SHOW, filename);
   imagedb.tagImage(vals2);


public long tagImage(ContentValues val){
        Log.d(TAG,"tagged Images");
        return db.insert(DATABASE_TABLE, null, val);
    }
</code></pre>

<p>retrieving :</p>

<pre><code>Cursor cursor = imagedb.retrieveTag(tag);

    /*method for retrieving*/

    public Cursor retrieveTag(String tag){
    String[] condition = {tag)};
    Cursor cursor = db.query(DATABASE_TABLE, condition, null, null, null, null, null);
        cursor.moveToNext();
        return cursor;
    }
</code></pre>

<p>The cursor is not returning anything and i sometimes get a CursorIndexOutofBoundsException.
Is this a correct way to save and retrieve from an sqlitedatabase or does the filename pose a problem for the sqlite database?.. How can i store it correctly?.. Thank you.</p>
