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 62 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
:D TYSM


cdmart10

  • Member
  • Posts: 332
Reply 3 on: Yesterday
Thanks for the timely response, appreciate it

 

Did you know?

Aspirin is the most widely used drug in the world. It has even been recognized as such by the Guinness Book of World Records.

Did you know?

The toxic levels for lithium carbonate are close to the therapeutic levels. Signs of toxicity include fine hand tremor, polyuria, mild thirst, nausea, general discomfort, diarrhea, vomiting, drowsiness, muscular weakness, lack of coordination, ataxia, giddiness, tinnitus, and blurred vision.

Did you know?

Anesthesia awareness is a potentially disturbing adverse effect wherein patients who have been paralyzed with muscle relaxants may awaken. They may be aware of their surroundings but unable to communicate or move. Neurologic monitoring equipment that helps to more closely check the patient's anesthesia stages is now available to avoid the occurrence of anesthesia awareness.

Did you know?

The heart is located in the center of the chest, with part of it tipped slightly so that it taps against the left side of the chest.

Did you know?

Persons who overdose with cardiac glycosides have a better chance of overall survival if they can survive the first 24 hours after the overdose.

For a complete list of videos, visit our video library