code: public synchronized void close(final boolean forceClose) throws SQLException {
          Collection<SQLException> exceptions = new LinkedList<>();
          MasterVisitedManager.clear();
          exceptions.addAll(closeResultSets());
          exceptions.addAll(closeStatements());
          if (!stateHandler.isInTransaction() || forceClose) {
              exceptions.addAll(releaseConnections(forceClose));
          }
          stateHandler.doNotifyIfNecessary();
          throwSQLExceptionIfNecessary(exceptions);
      }
docs: Close cached connection.
  
  @param forceClose force close flag
  @throws SQLException SQL exception