def METHOD_NAME(self):
    #
    # Old psycopg2 does not know how to ignore useless parameters
    #
    if not self._host:
        self._connection = psycopg2.connect(
            database=self._database,
        )
    else:
        #
        # Port cast is required as old psycopg2 does not support
        # unicode strings for port.
        # Do not cast to int to avoid breaking usock.
        #
        self._connection = psycopg2.connect(
            host=self._host,
            port=str(self._port),
            user=self._username,
            password=self._password,
            database=self._database,
            sslmode=self._sslmode,
        )
    # autocommit member is available at >= 2.4.2
    if hasattr(self._connection, 'autocommit'):
        self._connection.autocommit = self._autocommit
    else:
        self._connection.set_isolation_level(
            psycopg2.extensions.ISOLATION_LEVEL_AUTOCOMMIT
            if self._autocommit
            else psycopg2.extensions.ISOLATION_LEVEL_AUTOCOMMIT
        )