01.依赖包的导入
1 <!--mysql驱动--> 2 <dependency> 3 <groupId>mysql</groupId> 4 <artifactId>mysql-connector-java</artifactId> 5 <version>8.0.24</version> 6 </dependency> 7 <!--druid连接池--> 8 <dependency> 9 <groupId>com.alibaba</groupId> 10 <artifactId>druid</artifactId> 11 <version>1.2.6</version> 12 </dependency> 13 <!--测试单元--> 14 <dependency> 15 <groupId>junit</groupId> 16 <artifactId>junit</artifactId> 17 <version>4.12</version> 18 <scope>test</scope> 19 </dependency> 20 <!--Spring框架相关--> 21 <dependency> 22 <groupId>org.springframework</groupId> 23 <artifactId>spring-context</artifactId> 24 <version>5.2.12.RELEASE</version> 25 </dependency> 26 <dependency> 27 <groupId>org.springframework</groupId> 28 <artifactId>spring-jdbc</artifactId> 29 <version>5.2.10.RELEASE</version> 30 </dependency> 31 <dependency> 32 <groupId>org.springframework</groupId> 33 <artifactId>spring-tx</artifactId> 34 <version>5.2.10.RELEASE</version> 35 </dependency> 36 <dependency> 37 <groupId>org.springframework</groupId> 38 <artifactId>spring-test</artifactId> 39 <version>5.1.7.RELEASE</version> 40 </dependency>
02. 配置数据库连接参数
03. Spring配置
04. 测试配置