• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Difficulty in fetching password from a specific row

AQSAANUM

Member
Hey friends,

I have written the code for fetching id and password from sqlite database. When I remove password fetching statement it works fine but if I write password fetching statement and run the app, that doesn't works for me.
Without password fetching this works fine, but I have to fetch password for confirming that an id is existing in SQLite database, here is the code,
please see and suggest.

Java:
 SQLiteDatabase db = dbHelper.getReadableDatabase();
        Student student = new Student();
        Cursor cursor = db.query(Student.TABLE, new String[] {Student.KEY_ID, Student.KEY_password}
                , Student.KEY_ID +  "=?",
                new String[] { id }, null, null, null, null);

        if (cursor.getCount() == 0){
            loginTest = false;
            }
        if (cursor.moveToFirst()){
            cursor.getString(cursor.getColumnIndex(Student.KEY_password));
          return true;

            }
        return loginTest;
 
What "doesn't work"? Usual request, you know the script: Does the application crash? If so please provide stack trace.
 
What "doesn't work"? Usual request, you know the script: Does the application crash? If so please provide stack trace.
Sorry :) I have not posted the stack trace,
but as usual I have solved the problem :)
Thanks for comment on my programming post as usual :)
 
Back
Top Bottom