// 超时重试次数,达到这个值就报错
int notFullTimeoutRetryCnt = 0
for () {
// handle notFullTimeoutRetry
DruidPooledConnection poolableConnection
try {
// 核心逻辑
poolableConnection = getConnectionInternal(maxWaitMillis)
} catch (GetConnectionTimeoutException ex) {
if (notFullTimeoutRetryCnt <= this.notFullTimeoutRetryCount &&!isFull()) {
notFullTimeoutRetryCnt++
if (LOG.isWarnEnabled()) {
LOG.warn("get connection timeout retry : " + notFullTimeoutRetryCnt)
}
continue
}
throw ex
}
1.pom.xml
2.yml文件配置
3.访问
启动项目,访问druid管理页面- localhost:8080/druid/login.html,登录的用户名和密码,我在yml配置成test,所以用test登录就行,登录后页面如下:
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)