public function &setDatabaseName($database_name, $select_database = true)
    {
        if (empty($select_database) || $this->link->select_db($database_name)) {
            $this->database_name = $database_name;
        } else {
            throw new ConnectionException("Failed to select database '$database_name'");
        }

        return $this;
    }