Use JDBC to connect to the MySQL database-Typical Case Analysis (9)-financial account DAO design and implementation, jdbcmysql

Source: Internet
Author: User

Use JDBC to connect to the MySQL database-Typical Case Analysis (9)-financial account DAO design and implementation, jdbcmysql

Reprinted Please note:Http://blog.csdn.net/uniquewonderq

Problem: 1. Add a financial account: 2. Modify the information of a financial account. 3. modify the status of a financial account. 4. query all financial accounts. 5. query all the information of a financial account based on the ID of a financial account.
Solution: During Enterprise Development, the hierarchical mode is usually used. Presentation Layer + control layer + business layer + Persistence Layer + Data Source. The persistence layer is used to map the database content to objects through some technical framework, and perform database operations by operating these objects. The main purpose is to facilitate operations on the database by the differences between minutes Business Objects and the Relational Tables of the data source. The persistence layer can be implemented using technologies such as JDBC, Hibernate, and Mybatis. In this case, the DAO mode is used to implement the persistent layer through JDBC. The DAO mode is Data Access Object, that is, the Data Access Object. It exists between the data source and the business layer and encapsulates access details to the data, such as database connection, sending and executing SQL statements, and closing connection resources. DAO aims to completely separate underlying data access operations from high-level business logic operations, provide transparent data access services for the business layer, and enhance program flexibility. The DAO component encapsulates operations on data tables to provide data access services for business components. In business components, some simple business processing can be completed only by using a DAO component. However, some business processing is complicated, you need to use the nogogo DAO component. To ensure business integrity and reusability of DAO components, transaction control cannot be written in every method of DAO components. Instead, transaction control should be independently encapsulated and then applied in business methods.

Subsequent content, which will be updated in the future .....












Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.