AllExam Dumps

DUMPS, FREE DUMPS, VCP5 DUMPS| VMWARE DUMPS, VCP DUMPS, VCP4 DUMPS, VCAP DUMPS, VCDX DUMPS, CISCO DUMPS, CCNA, CCNA DUMPS, CCNP DUMPS, CCIE DUMPS, ITIL, EXIN DUMPS,


READ Free Dumps For Oracle- 1z0-804





Question ID 21431

Which represents part of a DAO design pattern?

Option A

interface EmployeeDAO {
int getID();
Employee findByID (intid);
void update();
void delete();
}

Option B

class EmployeeDAO {
int getID() { return 0;}
Employee findByID (int id) { return null;}
void update () {}
void delete () {}
}

Option C

class EmployeeDAO {
void create (Employee e) {}
void update (Employee e) {}
void delete (int id) {}
Employee findByID (int id) {return id}
}

Option D

interface EmployeeDAO {
void create (Employee e);
void update (Employee e);
void delete (int id);
Employee findByID (int id);
}

Option E

interface EmployeeDAO {
void create (Connection c, Employee e);
void update (Connection c, Employee e);
void delete (Connection c, int id);
Employee findByID (Connection c, int id);
}

Correct Answer D
Explanation


Question ID 21432

Given:

Which group of method is moved to a new class when implementing the DAO pattern?

Option A

public in getId ()
public String getContractDetails ()
public Void setContractDetails(String contactDetails)
public String getName ()
public void setName (String name)

Option B

public int getId ()
public String getContractDetails()
public String getName()
public Person getPerson(int id) throws Exception

Option C

public void setContractDetails(String contractDetails) public void setName(String name)

Option D

public Person getPerson(int id) throws Exception
public void createPerson(Person p) throws Exception
public void deletePerson(int id) throws Exception
public void updatePerson(Person p) throws Exception

Option F

Correct Answer: D

Explanation: The methods related directly to the entity Person is moved to a new class.
CRUD
Note:DAO Design Pattern
*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)

Example (here Customer is the main entity):
public class Customer {
private final String id;
private String contactName;
private String phone;
public void setId(String id) { this.id = id; }
public String getId() { return this.id; }
public void setContactName(String cn) { this.contactName = cn;} public String getContactName() { return
this.contactName; } public void setPhone(String phone) { this.phone = phone; } public String getPhone() { return
this.phone; }
}
public interface CustomerDAO {
public void addCustomer(Customer c) throws DataAccessException; public Customer getCustomer(String id)
throws DataAccessException; public List getCustomers() throws DataAccessException; public void
removeCustomer(String id) throws DataAccessException; public void modifyCustomer(Customer c) throws
DataAccessException; }

Correct Answer F
Explanation

Send email to admin@getfreedumps for new dumps request!!!