Closes the connection to the database.
427143
@Override
    public synchronized void close() {
        try {

            for (final PreparedStatementCapsule preparedStatement : stmts.values()) {
                try {
                    preparedStatement.ps.close();
                } catch (final SQLException e) {
                    logger.warn("Could not close statement.", e);
                }
            }

            stmts.clear();

            entities.forEach((key, mappedEntity) -> closeMappedEntity(mappedEntity));

            if (properties.isSchemaPolicyCreateDrop()) {
                dropAllEntities();
            }

            conn.close();
            logger.debug("Connection to database closed");

        } catch (final SQLException ex) {
            logger.warn("Unable to close connection", ex);
        }
    }
629564
@Override
	public void close() {
		if (connection != null) {
			try {
				if (!isRollbackOnly()) {
					commit();
				} else {
					rollback();
				}
				connection.close();
			} catch (SQLException e) {
				throw new UroborosqlSQLException(e);
			}
			connection = null;
		}
	}
1133225
public void close ()
        throws SQLException
    {
        if (_result != null) {
            _result.close();
            _result = null;
        }
        if (_stmt != null) {
            _stmt.close();
            _stmt = null;
        }
    }
470183
@Override
    public void closeConnection() throws JdbcServerException {
        if (!endpointConfiguration.isAutoConnect()) {
            handleMessageAndCheckResponse(JdbcMessage.closeConnection());
        }

        if (connections.decrementAndGet() < 0) {
            connections.set(0);
        }
    }
834357
public void close() throws SQLException {

        validate();

        try {
            this.connection.rollback();
            this.connection.clearWarnings();
            this.connectionDefaults.setDefaults(this.connection);
            this.connection.reset();
            fireCloseEvent();
        } catch (SQLException e) {
            fireSqlExceptionEvent(e);

            throw e;
        }
    }
1141793
protected void closeConnection(DatabaseConnection connection) throws SQLException {
		// this can return null if we are closing the pool
		ConnectionMetaData meta = connectionMap.remove(connection);
		IOUtils.closeThrowSqlException(connection, "SQL connection");
		logger.debug("closed connection {}", meta);
		closeCount++;
	}
1158777
def close(self):
        """"""
        if hasattr(self.db, 'close'):
            with self.write_mutex:
                self.db.close()
1008511
def close_connection(self, connection, force=False):
        """"""
        if force:
            try:
                connection.close()
            except self.operational_exceptions:
                self.config.logger.error('ConnectionFactory - failed closing')
            for name, conn in self.pool.iteritems():
                if conn is connection:
                    break
            del self.pool[name]
        else:
            pass
993882
def Close(self):
		
		if self.connection is not None:
			try:
				self.connection.commit()
				self.connection.close()
				self.connection = None
			except Exception, e:
				pass
1193674
public void close() {
    synchronized (lock) {
      while (!available.isEmpty()) {
        PooledConnection pci = available.pop();
        try {
          pci.close();
        } catch (SQLException e) {
        }
      }
      available = null;
      while (!used.isEmpty()) {
        PooledConnection pci = used.pop();
        pci.removeConnectionEventListener(connectionEventListener);
        try {
          pci.close();
        } catch (SQLException e) {
        }
      }
      used = null;
    }
    removeStoredDataSource();
  }
81020
public synchronized void close() {
        if (!closed && channel != null) {
            ConnectionWatchdog watchdog = channel.getPipeline().get(ConnectionWatchdog.class);
            watchdog.setReconnect(false);
            closed = true;
            channel.close();
        }
    }
907373
@Override
  public void close() throws IOException {
    try {
      try {
        if (this.failed && this.conn != null) {
          this.conn.rollback();
        }
      } finally {
        if (this.conn != null) {
          this.conn.close();
        }
      }
    } catch (SQLException e) {
      throw new RuntimeException(e);
    }
  }
809571
public function _disconnect()
    {
        if ( $this->db !== null )
        {
            mysqli_close( $this->db );
            $this->db = null;
        }
    }
1101050
@Override
    public void close() throws SQLException
    {
        try
        {
            isClosed = true;
            JDBC4ClientConnectionPool.dispose(NativeConnection);
        }
        catch(Exception x)
        {
            throw SQLError.get(x);
        }
    }
813297
async def close(self):
        """"""
        conn = self._connection
        if conn is None:
            return
        try:
            while (await self.nextset()):
                pass
        finally:
            self._connection = None
1342126
def close_database_session(session):
    """"""

    try:
        session.close()
    except OperationalError as e:
        raise DatabaseError(error=e.orig.args[1], code=e.orig.args[0])
629220
public void close() {
        try {
            String username = dataSource.getUsername();
            String password = dataSource.getPassword();
            dataSource.close();

            if (isEmbeddedDB()) {
                shutdownEmbeddedDB(username, password);
            }
        } catch (SQLException sqle) {
            logger.warn("Unable to close pool", sqle);
        } finally {
            if (logger.isDebugEnabled()) {
                logger.debug("Closed pool (" + toString() + ")");
            }
        }
    }