Connect MySQL database using JDBC-typical case study (ix) DAO design and implementation of----financial account number

Source: Internet
Author: User


Reprint Please specify : Http://blog.csdn.net/uniquewonderq

questions :1. New Financial account number: 2. Modify the information for a financial account. 3. Modify the status of a financial account. 4. Check all financial accounts. 5. Query the financial account ID for all information on the account.
solution :in the enterprise development, usually adopt the hierarchical pattern, the common level divides into the expression layer + the control layer + the business layer + the persistence layer + the data source. The function of the persistence layer is to map the contents of the database into objects through some technical cargo framework, and manipulate these objects to implement the operation of the database. Its main purpose is to minutes the difference between the business object and the data source, which facilitates the operation of the database. The persistence layer can be realized by Jdbc,hibernate,mybatis and other technologies. This case uses the DAO pattern to implement the persistence layer through JDBC. The DAO pattern is the data access object, which is the datasource. It exists between the data source and the business layer, encapsulating the details of access to the data, such as database connections, sending execution SQL statements, and closing the connection resources. The primary purpose of DAO is to completely separate the underlying data access operations from the high-level business logic operations, providing transparent data access services to the business layer and enhancing the flexibility of the program. The DAO component encapsulates the operation of a data table and provides data access services for business components. In business components, there are some simple business processes that can be done with only one method of a DAO component, but some of the business processes are complex and need to be done using the sword DAO component approach. To guarantee the integrity of the business and the reusability of DAO components, because transaction control cannot be written in every method of a DAO component, transaction control should be encapsulated separately and then applied in business methods.

subsequent content, future updates .....












Connect MySQL database using JDBC-typical case study (ix) DAO design and implementation of----financial account number

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.