[SSM Project Case] Database addition, deletion, modification and query - complete code

1. Build environment

1) Spring environment setup

2) spring integrates springmvc framework

Purpose: The method of the service object can be successfully called in the controller

When the project starts, load the configuration file of applicationContext.xml and configure it in web.xml

Inject the service object into the controller and call the method of the service object for debugging

3) Spring integrates the mybatis framework

Build and test mybatis environment

Write the main configuration file of mybatis-cofig.xml in the web project

Purpose: Configure all the contents in the mybatis-config.xml configuration file into the applicationContext.xml configuration file, and clear the contents of the mybatis configuration file at the same time.

Note: Since we are using the proxy dao mode, the specific implementation of dao is created by mybatis using the proxy method, so the mybatis configuration file cannot be deleted at this time.

2. Create database and tables

1. users user table

Create table

 Insert data

2. emp staff table

Create table

Supongo que te gusta

Origin blog.csdn.net/xjj1128/article/details/128209563
Recomendado
Clasificación