Closes a result set.
@param st
@param logger
763107
public static void closeResultSet( ResultSet resultSet, Logger logger ) {

		try {
			if( resultSet != null )
				resultSet.close();

		} catch( SQLException e ) {
			// Not important.
			Utils.logException( logger, e );
		}
	}
1277452
public void close(Result<Boolean> result)
  {
    _lifecycle.toDestroy();
    
    SegmentStream nodeStream = _nodeStream;
    _nodeStream = null;
      
    if (nodeStream != null) {
      nodeStream.closeFsync(result.then(v->closeImpl()));
    }
    else {
      result.ok(true);
    }
  }
371292
@Override
    public void close() {
        val bk = this.bookKeeper.getAndSet(null);
        if (bk != null) {
            try {
                bk.close();
            } catch (Exception ex) {
                log.error("Unable to close BookKeeper client.", ex);
            }
        }
    }
212292
public static void closeStatement( PreparedStatement ps, Logger logger ) {

		try {
			if( ps != null )
				ps.close();

		} catch( SQLException e ) {
			// Not important.
			Utils.logException( logger, e );
		}
	}
211734
public void setLogger(String logger)
    {
        if(logger != null && logger.trim().length() > 0)
            this.logger = LoggerFactory.getLogger(logger);
    }
174827
private void cleanConnectionClose(Connection connection, Statement stmt) {
        try {
            // clean close
            if (connection != null) {
                connection.rollback();
            }

            if (stmt != null) {
                stmt.close();
            }

            if (connection != null) {
                connection.close();
            }
        } catch (SQLException e1) {
            e1.printStackTrace();
        }
    }
81287
static void closeQuietly(ResultSet ps)
    {
        if (ps != null)
        {
            try
            {
                ps.getStatement().close();
                // ps.close();
            }
            catch (Exception e)
            {
                // Should go with the connection anyway.
                // jqmlogger.warn("Could not close a DB result set - possible pool leak", e);
            }
        }
    }
1335021
public void checkCloseOnCompletion(ResultSet resultSet) throws SQLException {
    if (mustCloseOnCompletion
        && !closed
        && results != null
        && resultSet.equals(results.getResultSet())) {
      close();
    }
  }
1088902
public void close(ResultSet rs, Statement st, Connection conn) {
		if (rs != null) {try {rs.close();} catch (SQLException e) {LogKit.error(e.getMessage(), e);}}
		if (st != null) {try {st.close();} catch (SQLException e) {LogKit.error(e.getMessage(), e);}}
		
		if (threadLocal.get() == null) {	// in transaction if conn in threadlocal
			if (conn != null) {try {conn.close();}
			catch (SQLException e) {throw new ActiveRecordException(e);}}
		}
	}
1217778
@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;
  }
104624
def close_log(log, verbose=True):
    

    if verbose:
        print('Closing log file:', log.name)

    # Send closing message.
    log.info('The log file has been closed.')

    # Remove all handlers from log.
    [log.removeHandler(handler) for handler in log.handlers]
66163
public void close() throws IOException
  {
    if (isClosed)
    {
      throw new IOException("Telemetry connector is closed");
    }
    try
    {
      this.sendBatch();
    }
    catch (IOException e)
    {
      logger.error("Send logs failed on closing", e);
    }
    finally
    {
      this.isClosed = true;
    }
  }
450643
public synchronized void close() {
        for (PreparedStatement ps : threadedPsMap.get().values()) {
            if (null != ps) {
                try {
                    ps.close();
                } catch (SQLException e) {
                    // swallowed
                }
            }
        }
        try {
            if (null != connection) {
                this.connection.close();
            }
        } catch (SQLException e) {
            // swallowed
        }
    }
355447
@Override
    public void close() {
        if (!this.closed) {
            this.closed = true;

            // If we have already returned a result but it hasn't been consumed yet, cancel it.
            CompletableFuture<ReadResultEntryContents> lastReturnedFuture = this.lastEntryFuture;
            if (lastReturnedFuture != null && !lastReturnedFuture.isDone()) {
                lastReturnedFuture.cancel(true);
                this.lastEntryFuture = null;
            }

            log.trace("{}.ReadResult[{}]: Closed.", this.traceObjectId, this.streamSegmentStartOffset);
        }
    }
738374
@Override
	public void close() {
		transactionManager.close();
		if (coverageHandlerRef.get() != null) {
			coverageHandlerRef.get().onSqlAgentClose();
		}
	}
360919
public static void closeConnection( Connection conn, Logger logger ) {

		try {
			if( conn != null )
				conn.close();

		} catch( SQLException e ) {
			// Not important.
			Utils.logException( logger, e );
		}
	}
1288752
@SuppressWarnings("unchecked")
	public void close() throws IOException {
		if(itr instanceof CloseableIterator) {
			CloseableIterator<E> toBeClosed = (CloseableIterator<E>) itr;
			toBeClosed.close();
		}
	}