spring cloud使用spring data jpa配置druid做数据源和监控
最新推荐文章于 2024-06-13 08:32:25 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)
druid数据源是非常好用的一款产品,有强大的监控和扩展功能,接下来就做一个在spring cloud中应用spring data jpa使用druid作为数据源和监控的服务提供者demo。
- spring cloud版本为Brixton.SR5,spring boot版本为1.4.0.RELEASE
pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.mysoft</groupId> <artifactId>cloud-provide-user-druid</artifactId> <version>0.0.1-SNAPSHOT</version> <!-- 使用最新的spring-boot版本 --> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.4.0.RELEASE</version> </parent> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <java.version>1.8</java.version> </properties> <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-dependencies</artifactId> <version>Brixton.SR5</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <dependencies> <!-- 添加Eureka的依赖 --> <dependency> <groupId>org.springframewo
03-29
383
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
09-11
209
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交
评论
![](https://csdnimg.cn/release/blogv2/dist/pc/img/closeBt.png)
![](https://csdnimg.cn/release/blogv2/dist/pc/img/closeBt.png)
![](https://csdnimg.cn/release/blogv2/dist/pc/img/commentArrowLeftWhite.png)
![](https://csdnimg.cn/release/blogv2/dist/pc/img/iconPark.png)
查看更多评论
![](https://csdnimg.cn/release/blogv2/dist/pc/img/commentArrowDownWhite.png)
添加红包
![](https://csdnimg.cn/release/blogv2/dist/pc/img/guideRedReward02.png)
![](https://csdnimg.cn/release/blogv2/dist/pc/img/guideRedReward03.png)