This topic contains a solution. Click here to go to the answer

Author Question: Analyze the following code: ResultSet resultSet = statement.executeQuery("select firstName, mi, ... (Read 63 times)

justinmsk

  • Hero Member
  • *****
  • Posts: 524

Question 1

Which of the following statements are true?
◦ You may create multiple statements from one connection.
◦ You can send queries and update statements through a Statement object.
◦ You may create multiple connections to a database.
◦ You may load multiple JDBC drivers in a program.

Question 2

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.


Related Topics

Need homework help now?

Ask unlimited questions for free

Ask a Question
Marked as best answer by justinmsk on May 6, 2020

momtoalll

  • Sr. Member
  • ****
  • Posts: 326
Lorsum iprem. Lorsus sur ipci. Lorsem sur iprem. Lorsum sur ipdi, lorsem sur ipci. Lorsum sur iprium, valum sur ipci et, vala sur ipci. Lorsem sur ipci, lorsa sur iprem. Valus sur ipdi. Lorsus sur iprium nunc, valem sur iprium. Valem sur ipdi. Lorsa sur iprium. Lorsum sur iprium. Valem sur ipdi. Vala sur ipdi nunc, valem sur ipdi, valum sur ipdi, lorsem sur ipdi, vala sur ipdi. Valem sur iprem nunc, lorsa sur iprium. Valum sur ipdi et, lorsus sur ipci. Valem sur iprem. Valem sur ipci. Lorsa sur iprium. Lorsem sur ipci, valus sur iprem. Lorsem sur iprem nunc, valus sur iprium.
Answer Preview
Only 25% of students answer this correctly




justinmsk

  • Member
  • Posts: 524
Reply 2 on: May 6, 2020
Excellent


LVPMS

  • Member
  • Posts: 323
Reply 3 on: Yesterday
Gracias!

 

Did you know?

Anti-aging claims should not ever be believed. There is no supplement, medication, or any other substance that has been proven to slow or stop the aging process.

Did you know?

Of the estimated 2 million heroin users in the United States, 600,000–800,000 are considered hardcore addicts. Heroin addiction is considered to be one of the hardest addictions to recover from.

Did you know?

Approximately one in four people diagnosed with diabetes will develop foot problems. Of these, about one-third will require lower extremity amputation.

Did you know?

There are 20 feet of blood vessels in each square inch of human skin.

Did you know?

Only 12 hours after an egg cell is fertilized by a sperm cell, the egg cell starts to divide. As it continues to divide, it moves along the fallopian tube toward the uterus at about 1 inch per day.

For a complete list of videos, visit our video library