Closes the connection to the MySQL instance, if connected.
327840
public static function disconnect(): void
  {
    if (self::$dl!==null)
    {
      self::$dl->disconnect();
      self::$dl = null;
    }
  }
509676
public function closeConnection () {
        if ( $this->transport->getSmtp()->isConnect()) {
            $this->transport->getSmtp()->rset();
            $this->transport->getSmtp()->disconnect();
        }
    }
1336203
def close(self):
        
        if getattr(self, '_connection', None):
            logger.debug('Closing postgresql connection.')
            self._connection.close()
            self._connection = None
        if getattr(self, '_engine', None):
            self._engine.dispose()
692218
def close(self):
        """"""

        if self.closed:
            return

        # Make sure no one minds the connection to be closed
        # This will help avoid MemoryError in other threads,
        # they will get sqlite3.ProgrammingError instead
        if not self.personal_lock.acquire(timeout=self.lock_timeout):
            raise LockTimeoutError(self)

        try:
            try:
                if self.in_transaction:
                    self.db_state.active_connection = None
                    self.db_state.transaction_lock.release()
            except sqlite3.ProgrammingError:
                pass

            if self._cursor is not None and not self._cursor.closed:
                self._cursor._cursor.close()
                self._cursor.closed = True

            if self.connection is not None:
                self.connection.close()

            self.closed = True
        finally:
            self.personal_lock.release()
993882
def Close(self):
		
		if self.connection is not None:
			try:
				self.connection.commit()
				self.connection.close()
				self.connection = None
			except Exception, e:
				pass
1158777
def close(self):
        """"""
        if hasattr(self.db, 'close'):
            with self.write_mutex:
                self.db.close()
936230
def close(self):
        ''''''
        if self._connection:
            self._connection_file.close()
            self._connection_file = None
            self._connection.close()
            self._connection = None
885454
def close_connection (self):
        """"""
        if self.url_connection is not None:
            try:
                self.url_connection.quit()
            except Exception:
                pass
            self.url_connection = None
1289763
protected function close()
	{
		Yii::trace('Closing DB connection','system.db.CDbConnection');
		$this->_pdo=null;
		$this->_active=false;
		$this->_schema=null;
	}
945588
public static function closeDbConnection()
    {
        if (isset(self::$dbLink)) {
            $dbConn = self::$dbLink;
            $dbConn->close();
            self::$dbLink = null;
        }
        
        return null;
    }
134535
public function close()
    {
        $stmt = null;
        $stmt = $this->getDbStatement(self::cyrus()->getDatabase());

        $stmt->closeCursor();
        $this->pdo = null;
        $this->closed = true;
    }
1134877
public function close(): void
    {
        if ($this->isClosed) {
            return;
        }

        $this->isEnding = true;
        $this->isClosed = true;

        $this->connection->close();
        $this->emit('close');

        $this->pool->rejectAll(new ConnectionClosedException());
    }
38467
public function close()
    {
        $this->connect_done = false;
        $this->conn->closeConnection();

        if ($this->mcache) {
            $this->mcache->close();
        }
    }
1263307
public void close() throws SQLException {
		try {

			if (this.resetConnectionOnClose /*FIXME: && !getAutoCommit() && !isTxResolved() */){
				/*if (this.autoCommitStackTrace != null){
						logger.debug(this.autoCommitStackTrace);
						this.autoCommitStackTrace = null; 
					} else {
						logger.debug(DISABLED_AUTO_COMMIT_WARNING);
					}*/
				rollback();
				if (!getAutoCommit()){
					setAutoCommit(true);
				}
			}

			if (this.logicallyClosed.compareAndSet(false, true)) {


				if (this.threadWatch != null){
					this.threadWatch.interrupt(); // if we returned the connection to the pool, terminate thread watch thread if it's
					// running even if thread is still alive (eg thread has been recycled for use in some
					// container).
					this.threadWatch = null;
				}

				if (this.closeOpenStatements){
					for (Entry<Statement, String> statementEntry: this.trackedStatement.entrySet()){
						statementEntry.getKey().close();
						if (this.detectUnclosedStatements){
							logger.warn(String.format(UNCLOSED_LOG_ERROR_MESSAGE, statementEntry.getValue()));		
						}
					}
					this.trackedStatement.clear();
				} 

				if (!this.connectionTrackingDisabled){
					pool.getFinalizableRefs().remove(this.connection);
				}

				ConnectionHandle handle = null;

				//recreate can throw a SQLException in constructor on recreation
				try {
				    handle = this.recreateConnectionHandle();
				    this.pool.connectionStrategy.cleanupConnection(this, handle);
				    this.pool.releaseConnection(handle);				    
				} catch(SQLException e) {
				    //check if the connection was already closed by the recreation
				    if (!isClosed()) {
				    	this.pool.connectionStrategy.cleanupConnection(this, handle);
				    	this.pool.releaseConnection(this);
				    }
				    throw e;
				}
				
				
				if (this.doubleCloseCheck){
					this.doubleCloseException = this.pool.captureStackTrace(CLOSED_TWICE_EXCEPTION_MESSAGE);
				}
			} else {
				if (this.doubleCloseCheck && this.doubleCloseException != null){
					String currentLocation = this.pool.captureStackTrace("Last closed trace from thread ["+Thread.currentThread().getName()+"]:\n");
					logger.error(String.format(LOG_ERROR_MESSAGE, this.doubleCloseException, currentLocation));
				}
			}
		} catch (SQLException e) {
			throw markPossiblyBroken(e);
		}
	}
475615
public function close() {
		if (!empty($this->result) && !is_bool($this->result)) {
			mysqli_free_result($this->result);
		}
		mysqli_close($this->driver);
		parent::close();
	}
1157013
public function closeConnection(): void
    {
        if ($this->isConnected) {
            @$this->currentLink->close();
            $this->isConnected = false;
            $this->currentLink = null;
            $this->currentDB = null;
            $this->selectedDB = '';
        }
    }
977303
def close(self):
        
        if self.connection is not None:
            self.connection.close()
        if self.connection_fd is not None:
            self.connection_fd.close()