Question: Given the table books in the figure and a ResultSet created by running the following SQL statement, which option prints the value 379? SELECT *

Given the table books in the figure and a ResultSet created by running the following SQL statement, which option prints the value 379? 

title varchar(255) Beginning Java Advanced Java num_pages integer 379 669

SELECT * FROM books WHERE title = 'Beginning Java'

A. System.out.println(rs.getInt(1));

B. System.out.println(rs.getInt(2));

C. System.out.println(rs.getInteger(1));

D. System.out.println(rs.getInteger(2));

title varchar(255) Beginning Java Advanced Java num_pages integer 379 669

Step by Step Solution

3.51 Rating (158 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To print the value 379 from the ResultSet you need to call the appropriate method to get the value f... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Oracle Questions!