mirror of
https://github.com/drtrang/druid-spring-boot.git
synced 2026-11-01 14:33:46 +00:00
example
This commit is contained in:
+1
-7
@@ -17,16 +17,10 @@ import java.util.Map;
|
||||
* @author trang
|
||||
*/
|
||||
@Configuration
|
||||
@Profile({"dynamic", "dynamic-dev-yaml", "dynamic-dev-props"})
|
||||
@Profile("dynamic")
|
||||
@Slf4j
|
||||
public class SpringDataSourceConfig {
|
||||
|
||||
// @Bean
|
||||
// public DruidDataSourceCustomizer druidDataSourceCustomizer() {
|
||||
// System.out.println("DruidDataSourceCustomizer...");
|
||||
// return (dataSource) -> dataSource.setMaxActive(66);
|
||||
// }
|
||||
|
||||
@Bean
|
||||
@Primary
|
||||
public DynamicDataSource dataSource(Map<String, DruidDataSource> druidDataSourceMap) {
|
||||
|
||||
+1
-67
@@ -86,13 +86,6 @@ spring:
|
||||
|
||||
debug: true
|
||||
|
||||
spring:
|
||||
profiles: default
|
||||
|
||||
---
|
||||
|
||||
debug: true
|
||||
|
||||
spring:
|
||||
profiles: dynamic
|
||||
autoconfigure:
|
||||
@@ -109,63 +102,4 @@ spring:
|
||||
max-open-prepared-statements: 50
|
||||
slave:
|
||||
max-active: 25
|
||||
max-open-prepared-statements: 25
|
||||
|
||||
---
|
||||
|
||||
spring:
|
||||
profiles: config
|
||||
datasource:
|
||||
url: jdbc:h2:file:./samples
|
||||
username: root
|
||||
password: Biyu5YzU+6sxDRbmWEa3B2uUcImzDo0BuXjTlL505+/pTb+/0Oqd3ou1R6J8+9Fy3CYrM18nBDqf6wAaPgUGOg==
|
||||
schema: classpath:/import.sql
|
||||
druid:
|
||||
config:
|
||||
enabled: true
|
||||
|
||||
---
|
||||
|
||||
spring:
|
||||
profiles: features
|
||||
datasource:
|
||||
url: jdbc:h2:file:./samples
|
||||
username: root
|
||||
password: Biyu5YzU+6sxDRbmWEa3B2uUcImzDo0BuXjTlL505+/pTb+/0Oqd3ou1R6J8+9Fy3CYrM18nBDqf6wAaPgUGOg==
|
||||
schema: classpath:/import.sql
|
||||
druid:
|
||||
# 默认开启,当前已开启
|
||||
stat:
|
||||
log-slow-sql: true
|
||||
slow-sql-millis: 1000
|
||||
# 默认关闭,需手动开启,当前已开启
|
||||
slf4j:
|
||||
enabled: true
|
||||
connection-log-enabled: false
|
||||
statement-sql-format-option:
|
||||
upp-case: true
|
||||
pretty-format: false
|
||||
statement-executable-sql-log-enable: true
|
||||
result-set-log-enabled: false
|
||||
# 默认关闭,需手动开启,当前已开启
|
||||
wall:
|
||||
enabled: true
|
||||
log-violation: true
|
||||
throw-exception: false
|
||||
config:
|
||||
delete-where-none-check: true
|
||||
# 默认关闭,需手动开启,当前已开启
|
||||
config:
|
||||
enabled: true
|
||||
# 默认关闭,需手动开启,当前已开启
|
||||
web-stat:
|
||||
enabled: true
|
||||
# 默认关闭,需手动开启,当前已开启
|
||||
aop-stat:
|
||||
enabled: true
|
||||
patterns:
|
||||
- com.github.trang.*
|
||||
# 默认关闭,需手动开启,当前已开启
|
||||
stat-view-servlet:
|
||||
enabled: true
|
||||
reset-enable: true
|
||||
max-open-prepared-statements: 25
|
||||
+2
@@ -81,6 +81,8 @@ spring:
|
||||
|
||||
mybatis:
|
||||
type-aliases-package: com.github.trang.druid.example.mybatis.model
|
||||
configuration:
|
||||
map-underscore-to-camel-case: true
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user