Java连接MySQL数据库之properties文件配置

[ mysql-dbconfig.properties ] 文件:

# 数据库驱动:
driverClassName:com.mysql.jdbc.Driver
# 数据库链接地址:
url:jdbc:mysql://localhost:3306/db_app?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
#数据库用户名:
username:root 
# 数据库密码: 
password:root  

# 数据库过滤状态
filters:stat  

# 链接设置
maxActive:20  
initialSize:1  
maxWait:60000  
minIdle:1  
maxIdle:20  

timeBetweenEvictionRunsMillis:60000  
minEvictableIdleTimeMillis:300000  

validationQuery:SELECT 'x'  
testWhileIdle:true  
testOnBorrow:false  
testOnReturn:false  

maxOpenPreparedStatements:20  
removeAbandoned:true  
removeAbandonedTimeout:1800  
logAbandoned:true  
©️2020 CSDN 皮肤主题: 技术黑板 设计师:CSDN官方博客 返回首页