nerdexam
Oracle

1Z0-805 · Question #90

Given: Person public Person(int id) public int getid() public String getContactDetails() public void setContactDetails(String contactDetails) public String getName() public void setName(String name)…

The correct answer is D. public person getPerson(int id) throws Exception. We move the most abstract highest level methods into a separate class. Note:Data Access Object Abstracts and encapsulates all access to a data source Manages the connection to the data source to obtain and store data Makes the code independent of the data sources and data…

Building Database Applications with JDBC

Question

Given:

Person public Person(int id) public int getid() public String getContactDetails() public void setContactDetails(String contactDetails) public String getName() public void setName(String name) public Person getPerson(int id) throws Exception public void createPerson(int id) throws Exception public Person deletePerson(int id) throws Exception public void updatePerson(Person p) throws Exception Which group of methods is moved to a new class when implementing the DAO pattern?

Options

  • Apublic int getId ()
  • Bpublic int getId ()
  • Cpublic void setContactDetails(String contactDetails)
  • Dpublic person getPerson(int id) throws Exception

How the community answered

(56 responses)
  • A
    14% (8)
  • B
    5% (3)
  • C
    4% (2)
  • D
    77% (43)

Explanation

We move the most abstract highest level methods into a separate class. Note:Data Access Object Abstracts and encapsulates all access to a data source Manages the connection to the data source to obtain and store data Makes the code independent of the data sources and data vendors (e.g. plain-text, xml, LDAP, MySQL, Oracle, DB2)

Topics

#DAO pattern#data access object#separation of concerns#design pattern

Community Discussion

No community discussion yet for this question.

Full 1Z0-805 Practice