From dce12677d03e1da461f88b4507e680ba457dc888 Mon Sep 17 00:00:00 2001 From: shlijun Date: Tue, 5 Nov 2024 17:21:52 +0800 Subject: [PATCH] =?UTF-8?q?=E9=AA=8C=E8=AF=81=E6=97=B6=EF=BC=8C=E5=8F=AA?= =?UTF-8?q?=E8=A6=81=E4=B8=8D=E6=8A=A5=E9=94=99=E5=B0=B1=E8=AE=A4=E4=B8=BA?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E6=9C=89=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Oracle JDBC连接初始化时无法指定Schema(与登录用户不同),通过验证连接进行状态验证的同时切换Schema(alter session set current_schema = xxxx),该语句没有返回值,rs.next()是false,导致使用异常 --- .../com/alibaba/druid/pool/ValidConnectionCheckerAdapter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/com/alibaba/druid/pool/ValidConnectionCheckerAdapter.java b/core/src/main/java/com/alibaba/druid/pool/ValidConnectionCheckerAdapter.java index a4fa014cf5..08f1311f20 100644 --- a/core/src/main/java/com/alibaba/druid/pool/ValidConnectionCheckerAdapter.java +++ b/core/src/main/java/com/alibaba/druid/pool/ValidConnectionCheckerAdapter.java @@ -66,7 +66,7 @@ public static boolean execValidQuery(Connection conn, String query, int validati stmt.setQueryTimeout(validationQueryTimeout); } rs = stmt.executeQuery(query); - return rs.next(); + return true; } finally { JdbcUtils.close(rs); if (!isDruidStatementConnection) {