From f23e2ce66fdf032b2560d5547c77f30eb8de0c75 Mon Sep 17 00:00:00 2001
From: hdy <1105738590@qq.com>
Date: 星期二, 11 三月 2025 19:21:43 +0800
Subject: [PATCH] 修改

---
 billion-admin/src/main/resources/application-druid.yml |   48 +++++++++++++++++++++++++++---------------------
 1 files changed, 27 insertions(+), 21 deletions(-)

diff --git a/billion-admin/src/main/resources/application-druid.yml b/billion-admin/src/main/resources/application-druid.yml
index adef446..3f227d9 100644
--- a/billion-admin/src/main/resources/application-druid.yml
+++ b/billion-admin/src/main/resources/application-druid.yml
@@ -2,30 +2,24 @@
 spring:
     datasource:
         type: com.alibaba.druid.pool.DruidDataSource
-        driverClassName: com.mysql.cj.jdbc.Driver
         druid:
             # 涓诲簱鏁版嵁婧�
             master:
-                url: jdbc:mysql://127.0.0.1:3306/billion-db?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
-                username: root
+                driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
+#                url: jdbc:sqlserver://183.134.244.158:1433;DatabaseName=billion-db
+#                username: sa
+#                password: JCDM@2023
+                url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=billion-db
+                username: sa
                 password: 123456
-#            master:
-#                url: jdbc:mysql://127.0.0.1:3306/billion-db?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
-#                username: root
 #                password: 123456
-            # 浠庡簱鏁版嵁婧�
-#            slave:
-#                # 浠庢暟鎹簮寮�鍏�/榛樿鍏抽棴
-#                enabled: false
-#                url: jdbc:mysql://127.0.0.1:3306/billion-db-self?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
-#                username: root
-#                password: root
+#                password: admin@123
             # 鍒濆杩炴帴鏁�
-            initialSize: 5
+            initialSize: 10
             # 鏈�灏忚繛鎺ユ睜鏁伴噺
-            minIdle: 10
+            minIdle: 20
             # 鏈�澶ц繛鎺ユ睜鏁伴噺
-            maxActive: 20
+            maxActive: 200
             # 閰嶇疆鑾峰彇杩炴帴绛夊緟瓒呮椂鐨勬椂闂�
             maxWait: 60000
             # 閰嶇疆杩炴帴瓒呮椂鏃堕棿
@@ -39,11 +33,15 @@
             # 閰嶇疆涓�涓繛鎺ュ湪姹犱腑鏈�澶х敓瀛樼殑鏃堕棿锛屽崟浣嶆槸姣
             maxEvictableIdleTimeMillis: 900000
             # 閰嶇疆妫�娴嬭繛鎺ユ槸鍚︽湁鏁�
-            validationQuery: SELECT 1 FROM DUAL
+            validationQuery: SELECT 1
             testWhileIdle: true
-            testOnBorrow: false
+            testOnBorrow: true
             testOnReturn: false
-            webStatFilter: 
+            # 缂撳瓨娓告爣锛岄粯璁alse
+            poolPreparedStatements: true
+            # 缂撳瓨娓告爣鏈�澶ф暟閲忥紝榛樿-1锛堜笉缂撳瓨锛�
+            max-open-prepared-statements: 50
+            webStatFilter:
                 enabled: true
             statViewServlet:
                 enabled: true
@@ -58,8 +56,16 @@
                     enabled: true
                     # 鎱QL璁板綍
                     log-slow-sql: true
-                    slow-sql-millis: 1000
+                    slow-sql-millis: 2000
                     merge-sql: true
                 wall:
                     config:
-                        multi-statement-allow: true
\ No newline at end of file
+                        multi-statement-allow: true
+            #杩炴帴鍑洪敊鍚庡啀灏濊瘯杩炴帴涓夋
+            connection-error-retry-attempts: 3
+            #瓒呰繃鏃堕棿闄愬埗鏄惁鍥炴敹
+            remove-abandoned: true
+            #瓒呮椂鏃堕棿锛涘崟浣嶄负绉掋��180绉�=3鍒嗛挓
+            remove-abandoned-timeout: 20
+            #鍏抽棴abanded杩炴帴鏃惰緭鍑洪敊璇棩蹇�
+            log-abandoned: false
\ No newline at end of file

--
Gitblit v1.9.3