Solved

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

Question 84

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

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents