参数配置说明
druid 参数配置详解 - halberd.lee - 博客园 (cnblogs.com)[这里是图片001]https://www.cnblogs.com/halberd-lee/p/11304790.htmlSpringboot中配置Druid
-
maven依赖
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <scope>runtime</scope> </dependency> <--druid依赖--> <dependency> <groupId>com.alibaba</groupId> <artifactId>druid-spring-boot-starter</artifactId> <version>1.1.10</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jdbc</artifactId> <version>2.5.3</version> </dependency>
-
yaml文件配置
spring:
datasource:
# 数据源基本配置
url: jdbc:mysql://localhost:3306/hotel?useUni