/** * <B>Note:</B> even though {@code Statement} is automatically closed when it is garbage * collected, it is better to close it explicitly to lower resource consumption. * * {@inheritDoc} */ @Override public void close() throws SQLException { if (queryExecutor == null) { // This might happen in case constructor throws an exception (e.g. host being not available). // When that happens the connection is still registered in the finalizer queue, so it gets finalized return; } releaseTimer(); queryExecutor.close(); openStackTrace = null; }
knownStates.put(hostSpec, hostStatus); if (!candidateHost.targetServerType.allowConnectingTo(hostStatus)) { queryExecutor.close(); continue;