Traditional Culture Encyclopedia - Traditional culture - What is factory pattern?
What is factory pattern?
DAO is the operation of adding, deleting, modifying and checking the data in the database, and the factory mode is the encapsulation of the database connection. Different databases have different connections (such as code 2); DAO functions: 1. DAO is used to encapsulate the Data Source; just
For example, Connection conn = DAOFacotry.createConnection(); you can put Driver. URL. username, passpword in DAO and then change the database type. For example, if you want to change MSSQL to Oracle, you only need to change getConnection in DAOFacory.
() inside Driver.URL. and the like; 2. DAO also encapsulates all operations on the database (such as the most basic CRUD operations); for example, if you want to insert a new user, then you only need to provide
An insertUser(User user) method is enough; the specific operation is implemented in DAO; then when you want to call DAO, you only need to know that insertUser(User) is used to insert a new user; you do not need to know
How is it achieved.
- Previous article:What physical examination centers are there in Xi 'an?
- Next article:How to Modify Swarm Star Skill Points
- Related articles
- What festival will Kongming Lantern be?
- Trapezoidal Split Features and Advantages and Disadvantages
- How to deal with the influence of anticorrosion maintenance of glass flake in desulfurization tower
- Characteristics of Ice-skin Moon Cake Dishes
- Characteristics of traditional interest types
- Exterior painting, newly built house in the countryside, the exterior wall would like to paint a layer of paint by myself. May I know the detailed steps and what materials are needed? Thank you!
- Illustrator of New Year Pictures in the Year of the Rabbit ¡ª¡ª How to draw New Year Pictures in the Year of the Rabbit?
- Tmall released the latest health care product management standards. How many days is the remaining shelf life of the products sold?
- Li Tie big move, seven naturalized will all enter the national football?
- Can I make handmade cloth bags at home? What kind of handmade cloth can be made?