1Z0-804 · Question #160
What design pattern does the Drivermanager.getconnection () method characterize?
The correct answer is B. Factory. DriverManager has a factory method getConnection() that returns a Connection object. A factory method is a method that creates and returns new objects. The factory pattern (also known as the factory method pattern) is a creational design pattern. A factory is a Java class that…
Question
What design pattern does the Drivermanager.getconnection () method characterize?
Options
- ADAO
- BFactory
- CSingleton
- Dcomposition
How the community answered
(49 responses)- A12% (6)
- B76% (37)
- C8% (4)
- D4% (2)
Explanation
DriverManager has a factory method getConnection() that returns a Connection object. A factory method is a method that creates and returns new objects. The factory pattern (also known as the factory method pattern) is a creational design pattern. A factory is a Java class that is used to encapsulate object creation code. A factory class instantiates and returns a particular type of object based on data passed to the factory. The different types of objects that are returned from a factory typically are subclasses of a common parent class. The method DriverManager.getConnection establishes a database connection. This method requires a database URL, which varies depending on your DBMS. The following are some examples of database URLs: MySQL, Java DB. Exam Questions, Study Guides, Practice Tests. Lead the way to help you pass any IT Certification exams, 100% Pass Guaranteed or Full Refund. Especially Cisco, CompTIA, Citrix, EMC, HP, Oracle, VMware, Juniper, Check Point, LPI, Nortel, EXIN and so on. Our Slogan: First Test, First Pass. Help you to pass any IT Certification exams at the first try. You can reach us at any of the email addresses listed below. Any problems about IT certification or our products, you could rely upon us, we will give you satisfactory answers in 24 hours.
Topics
Community Discussion
No community discussion yet for this question.