Spring Integration MyBatis Complete instance (sharing) _ Database other

Source: Internet
Author: User

In order to comb the contents of Spring Integration MyBatis (MAVEN+MYSQL) and spring Integration MyBatis (MAVEN+MYSQL) in the previous study , Prepare a complete example to complete a simple book management function, the main use of the technology include spring, MyBatis, maven and MySQL and so on. The final operating effect is as follows:

The project structure is as follows:

One, create a new MAVEN based Web project

1.1. Create a simple MAVEN project with the following project information:

1.2, modify the level of information, in the project right key to select Properties, and then select "Project Facets", first set the Java operating environment to 1.7, first remove the "Dynamic Web Module" before the tick, and then save the check, and then turn on the "Dynamic web Module ", the version Select" 3.0 "; here in the lower left solution a hyperlink appears, creating" Web Content "to complete the shutdown.

1.3, modify the project deployment content. Right-click Properties on the Item, select "Deplyment Assembly", delete the content that does not need to be published, such as: two directories with "test", WebContent directory, and add a WebApp directory under Main.

The modified results are as follows:

1.4, modify the content of the project. Copy the contents under WebContent to/src/main/webapp, and then delete the WebContent directory, and the resulting results are as follows:

1.5, add "Server Runtime", add the following results:

ii. creating databases and Tables

Third, add dependencies

Iv. New Pojo entity layer

V. New MyBatis SQL Map layer

Vi. Creating a service layer

Vii. completing the Spring consolidation MyBatis configuration

Viii. creating a servlet and implementing functionality

Ix. Test Run

The above spring integration MyBatis complete example (sharing) is a small series to share all the content, hope to give you a reference, but also hope that we support the cloud habitat community.

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.