protected function getConnection()
    {
        if ($this->url === null) {
            throw new BuildException("Url attribute must be set!", $this->getLocation());
        }

        try {
            $this->log("Connecting to " . $this->getUrl(), Project::MSG_VERBOSE);

            $user = null;
            $pass = null;

            if ($this->userId) {
                $user = $this->getUserId();
            }

            if ($this->password) {
                $pass = $this->getPassword();
            }

            $conn = new PDO($this->getUrl(), $user, $pass);
            $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

            try {
                $conn->setAttribute(PDO::ATTR_AUTOCOMMIT, $this->autocommit);
            } catch (PDOException $pe) {
                $this->log(
                    "Unable to enable auto-commit for this database: " . $pe->getMessage(),
                    Project::MSG_VERBOSE
                );
            }

            return $conn;
        } catch (PDOException $e) {
            throw new BuildException($e->getMessage(), $this->getLocation());
        }
    }