JSP Spring中Druid连接池配置详解
jdbc.properties
1
2
3
|
url=jdbc:postgresql://***.***.***.***:****/****
username=***
password=***
|
applicationContext.xml中配置bean
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
< bean id = "dataSource" class = "com.alibaba.druid.pool.DruidDataSource" init-method = "init" destroy-method = "close" >
< property name = "url" value = "${url}" />
< property name = "username" value = "${username}" />
< property name = "password" value = "${password}" />
< property name = "initialSize" value = "1" />
< property name = "minIdle" value = "1" />
< property name = "maxActive" value = "20" />
< property name = "maxWait" value = "60000" />
< property name = "timeBetweenEvictionRunsMillis" value = "60000" />
< property name = "minEvictableIdleTimeMillis" value = "300000" />
< property name = "validationQuery" value = "SELECT 'x'" />
< property name = "testWhileIdle" value = "true" />
< property name = "testOnBorrow" value = "false" />
< property name = "testOnReturn" value = "false" />
< property name = "poolPreparedStatements" value = "true" />
< property name = "maxPoolPreparedStatementPerConnectionSize" value = "20" />
< property name = "filters" value = "stat" />
< CODE> |
监控配置web.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
< filter >
< filter-name >DruidWebStatFilter< CODE> |
jsp复习资料汇总
[JSP]2017年1月24日asp教程编程辅导汇总
[ASP]2016年12月2日JSP快速入门教程汇总
[JSP]2016年12月2日jsp基本用法和命令汇总
[JSP]2016年10月3日ASP编码教程:如何实现/使用缓存
[ASP]2015年4月15日