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 60 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
Thanks for the timely response, appreciate it


bdobbins

  • Member
  • Posts: 326
Reply 3 on: Yesterday
:D TYSM

 

Did you know?

About 80% of major fungal systemic infections are due to Candida albicans. Another form, Candida peritonitis, occurs most often in postoperative patients. A rare disease, Candida meningitis, may follow leukemia, kidney transplant, other immunosuppressed factors, or when suffering from Candida septicemia.

Did you know?

Egg cells are about the size of a grain of sand. They are formed inside of a female's ovaries before she is even born.

Did you know?

Human kidneys will clean about 1 million gallons of blood in an average lifetime.

Did you know?

About 3.2 billion people, nearly half the world population, are at risk for malaria. In 2015, there are about 214 million malaria cases and an estimated 438,000 malaria deaths.

Did you know?

Cutaneous mucormycosis is a rare fungal infection that has been fatal in at least 29% of cases, and in as many as 83% of cases, depending on the patient's health prior to infection. It has occurred often after natural disasters such as tornados, and early treatment is essential.

For a complete list of videos, visit our video library