public function getDb($db = null)
    {
        if ($db === null) {
            return $this->getDefaultDb();
        }

        if (isset($this->dbs[$db])) {
            return $this->dbs[$db];
        }

        throw new Exception\InvalidArgumentException(
            'A DB adapter was tried to retrieve, but was not configured'
        );
    }