diff --git a/src/main/java/com/zaxxer/hikari/HikariConfig.java b/src/main/java/com/zaxxer/hikari/HikariConfig.java index b063be733..a2d154092 100644 --- a/src/main/java/com/zaxxer/hikari/HikariConfig.java +++ b/src/main/java/com/zaxxer/hikari/HikariConfig.java @@ -466,7 +466,11 @@ else if (idleTimeout < 30000 && idleTimeout != 0) idleTimeout = IDLE_TIMEOUT; } - if (!isJdbc4connectionTest && connectionTestQuery == null) + if (connectionTestQuery != null) + { + isJdbc4connectionTest = false; + } + else if (!isJdbc4connectionTest) { logger.error("Either jdbc4ConnectionTest must be enabled or a connectionTestQuery must be specified."); throw new IllegalStateException("Either jdbc4ConnectionTest must be enabled or a connectionTestQuery must be specified.");