lundi 14 décembre 2015

Can you store multiple strings in a Cursor (like an array)

I'm having a hard time understanding how to use Cursors for SQLite databases, and I'm wondering if Cursors work like an array, so that you can store multiple objects in them?

If so, could someone provide an example of how to take multiple strings from a database and store it in to a cursor?

I have this code so far, I'm trying to store the data from the result of matching codes from the code[] array with a database, then storing the result in the Cursor:

for (int i=1;i<code.length;i++) {
        cursor = myDataBase.query("codes", new String[]{"description"}, ("code = '" + code[i] + "'" ), null, null, null, null);
    }

Thanks.!!

Aucun commentaire:

Enregistrer un commentaire