File tree 4 files changed +47
-59
lines changed
4 files changed +47
-59
lines changed Original file line number Diff line number Diff line change 2
2
3
3
import org .springframework .boot .SpringApplication ;
4
4
import org .springframework .boot .autoconfigure .SpringBootApplication ;
5
+ import org .springframework .boot .autoconfigure .domain .EntityScan ;
5
6
import org .springframework .boot .context .ApplicationPidFileWriter ;
6
7
7
8
import java .io .File ;
8
9
10
+ @ EntityScan ("com.haizhi.template.bean" )
9
11
@ SpringBootApplication
10
12
public class Application {
11
13
Original file line number Diff line number Diff line change 1
1
spring :
2
+ redis :
3
+ host : 127.0.0.1
4
+ port : 6379
5
+ database : 0
6
+ password : liuyu
2
7
jpa :
3
8
show-sql : true
4
- database-platform : mysql
9
+ database : mysql
5
10
hibernate :
6
- ddl-auto : update
11
+ ddl-auto : create
7
12
datasource :
13
+ driver-class-name : com.mysql.cj.jdbc.Driver
14
+ url : jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=UTF-8&useSSL=false&useTimezone=true&serverTimezone=Asia/Shanghai
15
+ username : root
16
+ password : 12345
17
+ type : com.zaxxer.hikari.HikariDataSource
8
18
hikari :
9
19
auto-commit : true
10
- jdbc-url : jdbc:mysql://127.0.0.1:3306/liuyu?useUnicode=true&characterEncoding=UTF-8&useSSL=false&useTimezone=true&serverTimezone=Asia/Shanghai
11
- driver-class-name : com.mysql.cj.jdbc.Driver
12
- username : root
13
- password : 12345
20
+ connection-timeout : 10000
21
+ idle-timeout : 180000
22
+ max-lifetime : 1800000
23
+ minimum-idle : 4
24
+ maximum-pool-size : 8
25
+ initialization-fail-timeout : 1
26
+ pool-name : Hikari-pool
27
+
14
28
15
29
logging :
16
30
config : classpath:config/logback-spring-dev.xml
Original file line number Diff line number Diff line change 1
1
spring :
2
+ redis :
3
+ host : 127.0.0.1
4
+ port : 6379
5
+ database : 0
6
+ password : liuyu
7
+ jpa :
8
+ show-sql : true
9
+ database : mysql
10
+ hibernate :
11
+ ddl-auto : create
2
12
datasource :
3
- druid :
4
- username : root
5
- password : 12345
6
- driver-class-name : com.mysql.cj.jdbc.Driver
7
- url : jdbc:mysql://127.0.0.1:3306/liuyu?useUnicode=true&characterEncoding=UTF-8&useSSL=false&useTimezone=true&serverTimezone=Asia/Shanghai
8
- # rewriteBatchedStatements=true 开启批处理
9
- # 初始化时建立物理连接的个数
10
- initial-size : 4
11
- # 最大连接池数量
12
- max-active : 8
13
- # 最小连接池数量
14
- min-idle : 4
15
- # 用来检测连接是否有效的sql
16
- validation-query : select 1 from dual;
17
- # 申请连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能
18
- test-on-borrow : false
19
- # 建议配置为true,不影响性能,并且保证安全性。申请连接的时候检测
20
- # 如果空闲时间大于timeBetweenEvictionRunsMillis,执行validationQuery检测连接是否有效。
21
- test-while-idle : true
22
- # 有两个含义:1) Destroy线程会检测连接的间隔时间2) testWhileIdle的判断依据,详细看testWhileIdle属性的说明
23
- time-between-eviction-runs-millis : 10000
24
- # 获取连接时最大等待时间,单位毫秒。配置了maxWait之后,缺省启用公平锁,并发效率会有所下降
25
- # 如果需要可以通过配置useUnfairLock属性为true使用非公平锁。
26
- max-wait : 5000
27
- use-unfair-lock : true
28
- query-timeout : 5000
29
- # 要求程序从池中get到连接后, N 秒后必须close,否则druid 会强制回收
30
- remove-abandoned : true
31
- remove-abandoned-timeout : 60
32
- web-stat-filter :
33
- enabled : true
34
- stat-view-servlet :
35
- enabled : true
36
- login-username : liuyu
37
- login-password : 12345
38
- filter :
39
- stat :
40
- enabled : true
41
- merge-sql : true
42
- slow-sql-millis : 5000
43
- log-slow-sql : true
44
- # slf4j:
45
- # enabled: true
46
- # result-set-log-enabled: true
47
- # connection-log-enabled: true
48
- # data-source-log-enabled: true
49
- # statement-log-enabled: true
50
- # statement-executable-sql-log-enable: true
13
+ driver-class-name : com.mysql.cj.jdbc.Driver
14
+ url : jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=UTF-8&useSSL=false&useTimezone=true&serverTimezone=Asia/Shanghai
15
+ username : root
16
+ password : 12345
17
+ type : com.zaxxer.hikari.HikariDataSource
18
+ hikari :
19
+ auto-commit : true
20
+ connection-timeout : 10000
21
+ idle-timeout : 180000
22
+ max-lifetime : 1800000
23
+ minimum-idle : 4
24
+ maximum-pool-size : 8
25
+ initialization-fail-timeout : 1
26
+ pool-name : Hikari-pool
51
27
52
28
53
29
logging :
Original file line number Diff line number Diff line change 3
3
name : template
4
4
profiles :
5
5
active : dev
6
- redis :
7
- host : 127.0.0.1
8
- port : 6379
9
- database : 0
10
- password : liuyu
6
+
11
7
server :
12
8
port : 8080
13
9
logging :
You can’t perform that action at this time.
0 commit comments