From c80c28153a62f9be5e1d1c1dc098cd523b8a0080 Mon Sep 17 00:00:00 2001 From: Maximus Date: Wed, 3 Aug 2022 16:04:56 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-77015=20Druid=E8=BF=9E=E6=8E=A5=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E6=97=B6=E6=8A=9B=E5=87=BA=E7=9A=84=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E4=B8=8D=E6=96=B9=E4=BE=BF=E7=9B=B4=E6=8E=A5=E6=9F=A5=E7=9C=8B?= =?UTF-8?q?=E5=8E=9F=E5=9B=A0=EF=BC=8C10.0=E6=98=AF=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/third/alibaba/druid/pool/DruidDataSource.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fine-druid/src/main/java/com/fr/third/alibaba/druid/pool/DruidDataSource.java b/fine-druid/src/main/java/com/fr/third/alibaba/druid/pool/DruidDataSource.java index b27276b28..e2c9028f1 100644 --- a/fine-druid/src/main/java/com/fr/third/alibaba/druid/pool/DruidDataSource.java +++ b/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); }