SpringBoot如何整合druid

2021-08-19 18:51:55 字數 714 閱讀 9610

springboot相比mvc來說,在配置上極大的節省了開發者的時間與精力,這無疑對開發者是一種不可抗拒的**,今天筆者就springboot如何整合druid跟大夥作個分享;

①druid的pom依賴

com.alibaba

druid-spring-boot-starter

1.1.4

#datasource

spring:

datasource:

druid:

url: jdbc:mysql://ip/dbname?useunicode=true&usessl=false&autoreconnect=true

username: *********xx

password: ************

driverclassname: com.mysql.jdbc.driver

#最大活躍數

maxactive: 20

#初始化數量

initialsize: 1

#最大連線等待超時時間

maxwait: 60000

#開啟pscache,並且指定每個連線pscache的大小

poolpreparedstatements: true

maxpoolpreparedstatementpercon

SpringBoot如何整合kafka集群

目錄結構 pom依賴 org.springframework.boot spring boot starter parent 2.0.1.release org.springframework.kafka spring kafka org.springframework.boot spring bo...

SpringBoot中如何整合Servlet呢?

下文筆者將講述兩種springboot整合servlet的方法,如下所示 實現思路 方式1 使用全註解的方式開發 1.1 在啟動類上面加上註解 servletcomponentscan 1.2 編寫servlet程式,並在servlet程式上加上註解 webservlet name testserv...

SpringBoot如何整合nacos詳解

nacos支援基於dns和基於rpc的服務發現,可以作為springcloud的註冊中心 動態配置服務 動態dns服務。nacos註冊中心分為server和client,server採用j a編寫,為client提供註冊發現與配置服務。中介軟體 因為推薦使用的是2.0.1版本,我這裡 2.0.1版本...