Browse Source

Merge pull request #6477 in CORE/base-third from release/11.0 to bugfix/11.0

* commit '8ceac600974f2fcd9c75c333c5addcc82ca5fba2':
  REPORT-77015 Druid连接失败时抛出的报错不方便直接查看原因,10.0是可以的
bugfix/11.0
superman 2 years ago
parent
commit
1886ca3bab
  1. 8
      fine-druid/src/main/java/com/fr/third/alibaba/druid/pool/DruidDataSource.java

8
fine-druid/src/main/java/com/fr/third/alibaba/druid/pool/DruidDataSource.java

@ -1387,7 +1387,7 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat
|| realDriverClassName.equals(JdbcConstants.POLARDB_DRIVER)) {
this.validConnectionChecker = new PGValidConnectionChecker();
} else if (realDriverClassName.equals(JdbcConstants.OCEANBASE_DRIVER)
|| (realDriverClassName.equals(JdbcConstants.OCEANBASE_DRIVER2))) {
|| (realDriverClassName.equals(JdbcConstants.OCEANBASE_DRIVER2))) {
DbType dbType = DbType.of(this.dbTypeName);
this.validConnectionChecker = new OceanBaseValidConnectionChecker(dbType);
}
@ -1830,7 +1830,11 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat
String errorMessage = buf.toString();
if (createError != null) {
throw new GetConnectionTimeoutException(errorMessage, createError);
if (createError instanceof SQLException) {
throw (SQLException)createError;
} else {
throw new GetConnectionTimeoutException(errorMessage, createError);
}
} else {
throw new GetConnectionTimeoutException(errorMessage);
}

Loading…
Cancel
Save