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