Data paging Jdbc+mysql implementation

Source: Internet
Author: User

Through the simple rough function of the imperfect customer management case embodies jdbc+mysql data paging, rather than the management system, rather than a JDBC data distribution of the demo. But then again, the perfectly formed. Although it is a small demo, but the use of some of the more upward thinking, can also be said to be the highlight of the small demo.
Simple MySQL database paging is simpler, a statement can be done, but use JSP to do or to tip energy. The difficulty of the database is ignored, the remaining thing is how to show and pass the parameters in the program. It may take the most time to do it in front of the display, and then down is the paging of these data organization.
1. The idea of layered software
Classic Javaweb three-tier architecture
2. Factory design mode
Reduces the coupling between layers and layers
3. Single Case design mode
Ensure that only one instance of the class is generated
4. Interface-Oriented programming
The embodiment of the multi-state of object-oriented thought
5, Data Information encapsulation
Encapsulation of paging information objects
It seems to have said some nonsense, or to get into the subject or run off. To talk about the paging in the demo, the servlet does not do the page display, and by invoking the service layer method returns an object that encapsulates the distribution information and forwards it to the JSP page display. The idea that the paging information object is generated in the service and contains the data to be displayed on the page in the paging information is very good, obviously not what I thought. The service calls the DAO method to get a collection of encapsulated JavaBean information, and then, through the service encapsulation, the paging information and the JavaBean collection are then encapsulated in the paging object together back to the servlet and forwarded to the JSP page. Page-by-page display of data on pages via labels and El expressions.
Said all these are not intuitive, interested in the pot friends can download the source to see, here first on a picture to show the page effect.
Http://pan.baidu.com/s/1nt2qGq9

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.