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 70 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


diana chang

  • Member
  • Posts: 288
Reply 3 on: Yesterday
Excellent

 

Did you know?

Once thought to have neurofibromatosis, Joseph Merrick (also known as "the elephant man") is now, in retrospect, thought by clinical experts to have had Proteus syndrome. This endocrine disease causes continued and abnormal growth of the bones, muscles, skin, and so on and can become completely debilitating with severe deformities occurring anywhere on the body.

Did you know?

The senior population grows every year. Seniors older than 65 years of age now comprise more than 13% of the total population. However, women outlive men. In the 85-and-over age group, there are only 45 men to every 100 women.

Did you know?

According to the National Institute of Environmental Health Sciences, lung disease is the third leading killer in the United States, responsible for one in seven deaths. It is the leading cause of death among infants under the age of one year.

Did you know?

Patients who have undergone chemotherapy for the treatment of cancer often complain of a lack of mental focus; memory loss; and a general diminution in abilities such as multitasking, attention span, and general mental agility.

Did you know?

In the United States, there is a birth every 8 seconds, according to the U.S. Census Bureau's Population Clock.

For a complete list of videos, visit our video library