admin
2024-10-15 6d313a4a6f9f9d7ea65ec50ab0d4491e595edb97
提交 | 用户 | 时间
e57a89 1 # 数据源配置
2 spring:
3 #    datasource:
4 #        type: com.alibaba.druid.pool.DruidDataSource
5 #        driverClassName: com.mysql.cj.jdbc.Driver
6 #        druid:
7 #            # 主库数据源
8 #            master:
9 #                url: jdbc:mysql://192.168.0.189:3306/jcdm-mes-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
10 #                username: root
11 #                password: root
12     # 数据源配置
13     datasource:
14         type: com.alibaba.druid.pool.DruidDataSource
15         driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
16         druid:
17             # 主库数据源
18             master:
42cfe3 19 #                url: jdbc:sqlserver://192.168.0.189:1433;DataBaseName=Jcdm042-Mes
b5fcd8 20 #                url: jdbc:sqlserver://183.134.244.158:1433;DataBaseName=Jcdm042-Mes
21                 url: jdbc:sqlserver://127.0.0.1:1433;DataBaseName=Jcdm042-Mes
e57a89 22                 username: sa
b5fcd8 23 #                password: JCDM@2023
c1da6d 24                 password: admin@123
A 25 #                password: 1!deshine
2c7661 26 #                password: 123456
A 27
5316c5 28
e57a89 29             # 从库数据源
30             slave:
31                 # 从数据源开关/默认关闭
32                 enabled: false
33                 url:
34                 username:
35                 password:
36             # 初始连接数
37             initialSize: 5
38             # 最小连接池数量
39             minIdle: 10
40             # 最大连接池数量
41             maxActive: 20
42             # 配置获取连接等待超时的时间
43             maxWait: 60000
44             # 配置连接超时时间
45             connectTimeout: 30000
46             # 配置网络超时时间
47             socketTimeout: 60000
48             # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
49             timeBetweenEvictionRunsMillis: 60000
50             # 配置一个连接在池中最小生存的时间,单位是毫秒
51             minEvictableIdleTimeMillis: 300000
52             # 配置一个连接在池中最大生存的时间,单位是毫秒
53             maxEvictableIdleTimeMillis: 900000
54             # 配置检测连接是否有效
55 #            validationQuery: SELECT 1 FROM DUAL
56             validationQuery: SELECT 1
57             testWhileIdle: true
58             testOnBorrow: false
59             testOnReturn: false
60             webStatFilter:
61                 enabled: true
62             statViewServlet:
63                 enabled: true
64                 # 设置白名单,不填则允许所有访问
65                 allow:
66                 url-pattern: /druid/*
67                 # 控制台管理用户名和密码
68                 login-username: jcdm
69                 login-password: 123456
70             filter:
71                 stat:
72                     enabled: true
73                     # 慢SQL记录
74                     log-slow-sql: true
75                     slow-sql-millis: 1000
76                     merge-sql: true
77                 wall:
78                     config:
79                         multi-statement-allow: true