Solved

Consider the Following Code Snippet to Query SQLite Database: String[]

Question 99

Multiple Choice

Consider the following code snippet to query SQLite database: String[] result_columns = new String[] {KEY_ID, COL1, COL2}; Cursor allRows = myDatabase.query(true, DATABASE_TABLE, result_columns, null, null, null, null, null, null) ; Which of the following prints out the values of COL1 column correctly if the result is not empty?


A) if (allRows.moveToFirst() ) {              do {             
System.out.println(allRows.getString(1) ) ;             
}
While (allRows.moveToNext() ) ; }
B) do {              System.out.println(allRows.getString(0) ) ; while (allRows.moveToNext() ) ;
C) /system/app/<package name>/files
D) if (allRows!= null) { while (!allRows.isNull() ) ; }

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions