All Downloads are FREE. Search and download functionalities are using the official Maven repository.

config.properties.datasource.properties Maven / Gradle / Ivy

The newest version!
# 数据库访问配置
# 主数据源,默认的
druid.datasource.driverClassName=com.mysql.jdbc.Driver
druid.datasource.url=jdbc:mysql://127.0.0.1:3306/distributed_transaction?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=UTF-8&useSSL=true
druid.datasource.username=root
druid.datasource.password=admin
 
# 下面为连接池的补充设置,应用到上面所有数据源中
# 初始化大小,最小,最大
# 初始化连接大小
druid.datasource.initialSize=5
# 连接池最小空闲连接数
druid.datasource.minIdle=5
# 连接池最大使用连接数
druid.datasource.maxActive=20
# 获取连接最大等待时间
druid.datasource.maxWait=60000
#自动清除无用连接
druid.datasource.removeAbandoned=true
#清除无用连接的等待时间
druid.datasource.removeAbandonedTimeout=180
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
druid.datasource.timeBetweenEvictionRunsMillis=60000
# 配置一个连接在池中最小生存的时间,单位是毫秒
druid.datasource.minEvictableIdleTimeMillis=300000

druid.datasource.validationQuery=SELECT 1 FROM DUAL
druid.datasource.testWhileIdle=true
druid.datasource.testOnBorrow=false
druid.datasource.testOnReturn=false

# 打开PSCache,并且指定每个连接上PSCache的大小
druid.datasource.poolPreparedStatements=true
druid.datasource.maxPoolPreparedStatementPerConnectionSize=20
# 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
druid.datasource.filters=stat,wall,log4j
# 通过connectProperties属性来打开mergeSql功能;慢SQL记录
druid.datasource.connectionProperties=druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000;clientEncoding=UTF-8
# 合并多个DruidDataSource的监控数据
#druid.datasource.useGlobalDataSourceStat=true




© 2015 - 2025 Weber Informatics LLC | Privacy Policy