Top Posters
Since Sunday
New Topic  
Gideon123 Gideon123
wrote...
Posts: 524
3 years ago
Analyze the following code:

ResultSet resultSet = statement.executeQuery
("select firstName, mi, lastName from Student where lastName "
+ " = 'Smith'");
System.out.println(resultSet.getString(1));


▸ If the SQL SELECT statement returns no result, resultSet is null.

▸ resultSet.getString(1) returns the firstName field in the result set.

▸ resultSet.getString(1) returns the mi field in the result set.

▸ The program will have a runtime error, because the cursor in resultSet does not point to a row. You must use resultSet.next() to move the cursor to the first row in the result set. Subsequently, resultSet.next() moves the cursor to the next row in the result set.
Textbook 
Introduction to Java Programming, Comprehensive Version

Introduction to Java Programming, Comprehensive Version


Edition: 10th
Author:
Read 31 times
1 Reply
Replies
Answer verified by a subject expert
kiyomikakiyomika
wrote...
Posts: 409
3 years ago
Sign in or Sign up in seconds to unlock everything for free
More solutions for this book are available here

Related Topics

Gideon123 Author
wrote...

3 years ago
This calls for a celebration Person Raising Both Hands in Celebration
wrote...

Yesterday
Good timing, thanks!
wrote...

2 hours ago
This site is awesome
New Topic      
Explore
Post your homework questions and get free online help from our incredible volunteers
  1280 People Browsing
Related Images
  
 359
  
 452
  
 841
Your Opinion
Where do you get your textbooks?
Votes: 372

Previous poll results: How often do you eat-out per week?