1Z0-804 · Question #66
ITEM Table ID, INTEGER: PK DESCRIP, VARCHAR(100) PRICE, REAL QUALITY, INTEGER And given the code fragment (assuming that the SQL query is valid): What is the result of compiling and executing this…
The correct answer is C. The code prints Error. Compiles successfully ! Not B ! D is correct, if Column Quantity instead of Quality Table Item Column Quality --- System.out.println("Quantity: " + rs.getInt("Quantity")); wenn jedoch so gewollt: die Zeile gibt Error aus (die anderen funktionieren) !!! The connection conn is…
Question
ITEM Table
- ID, INTEGER: PK
- DESCRIP, VARCHAR(100)
- PRICE, REAL
- QUALITY, INTEGER
And given the code fragment (assuming that the SQL query is valid):
What is the result of compiling and executing this code?
Exhibit
Options
- AAn exception is thrown at runtime
- BCompile fails
- CThe code prints Error
- DThe code prints information about Item 110
How the community answered
(41 responses)- A5% (2)
- B2% (1)
- C80% (33)
- D12% (5)
Explanation
Compiles successfully ! Not B ! D is correct, if Column Quantity instead of Quality Table Item Column Quality --- System.out.println("Quantity: " + rs.getInt("Quantity")); wenn jedoch so gewollt: die Zeile gibt Error aus (die anderen funktionieren) !!! The connection conn is not defined. The code will not compile.
Topics
Community Discussion
No community discussion yet for this question.
