Top Posters
Since Sunday
r
4
L
4
3
d
3
M
3
l
3
V
3
s
3
d
3
a
3
g
3
j
3
New Topic  
Gideon123 Gideon123
wrote...
Posts: 524
4 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 44 times
1 Reply
Replies
Answer verified by a subject expert
kiyomikakiyomika
wrote...
Posts: 410
4 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...

4 years ago
Good timing, thanks!
wrote...

Yesterday
I appreciate what you did here, answered it right Smiling Face with Open Mouth
wrote...

2 hours ago
this is exactly what I needed
New Topic      
Explore
Post your homework questions and get free online help from our incredible volunteers
  1885 People Browsing
Related Images
  
 193
  
 4491
  
 403
Your Opinion
Who will win the 2024 president election?
Votes: 119
Closes: November 4