Get db adapter

@return  \Zend\Db\Adapter\Adapter
358780
protected function getDbAdapter()
    {
        if ( null === $this->dbAdapter )
        {
            $this->dbAdapter = $this->getServiceManager()
                                    ->get( 'Zend\Db\Adapter\Adapter' );
        }

        return $this->dbAdapter;
    }
1072417
public function getConnection()
    {
        if ($this->conn === false) {
            $this->conn = null;
            if ($this->url) {
                $buf = "Using database settings:\n"
                    . " URL: " . $this->url . "\n"
                    . ($this->userId ? " user: " . $this->userId . "\n" : "")
                . ($this->password ? " password: " . $this->password . "\n" : "");

                $this->log($buf, Project::MSG_VERBOSE);

                // Set user + password to null if they are empty strings
                if (!$this->userId) {
                    $this->userId = null;
                }
                if (!$this->password) {
                    $this->password = null;
                }
                try {
                    $this->conn = new PDO($this->url, $this->userId, $this->password);
                    $this->conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
                } catch (PDOException $x) {
                    $this->log("Unable to create a PDO connection: " . $x->getMessage(), Project::MSG_WARN);
                }
            }
        }

        return $this->conn;
    }
860556
public function getAdapter()
    {
        if ($this->adapter instanceof Compress\CompressionAlgorithmInterface) {
            return $this->adapter;
        }

        $adapter = $this->adapter;
        $options = $this->getAdapterOptions();
        if (!class_exists($adapter)) {
            $adapter = 'Zend\\Filter\\Compress\\' . ucfirst($adapter);
            if (!class_exists($adapter)) {
                throw new Exception\RuntimeException(sprintf(
                    '%s unable to load adapter; class "%s" not found',
                    __METHOD__,
                    $this->adapter
                ));
            }
        }

        $this->adapter = new $adapter($options);
        if (!$this->adapter instanceof Compress\CompressionAlgorithmInterface) {
            throw new Exception\InvalidArgumentException("Compression adapter '" . $adapter . "' does not implement Zend\\Filter\\Compress\\CompressionAlgorithmInterface");
        }
        return $this->adapter;
    }
74870
public static function db()
    {
        self::$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
        return self::$conn;
    }
339444
public function getAdminAdapter() {
		if ($this->adminAdapter === null) {
			$this->adminAdapter = $this->adapterFactory->createAdminAdapter($this);
		}
		return $this->adminAdapter;
	}
1220273
private function getAdapterNode()
    {
        $node = $this->createRootNode('adapter');
        return $node
            ->isRequired()
            ->addDefaultsIfNotSet()
            ->children()
                ->enumNode('type')
                    ->values(['jsonapiorg', null])
                ->end()
                ->scalarNode('service')->cannotBeEmpty()->end()
            ->end()
            ->validate()
                ->always(function($v) {
                    $this->validateAdapter($v);
                    return $v;
                })
            ->end()
        ;
    }
782813
public function getExporter()
	{
		// Derive the class name from the driver.
		$class = '\\Joomla\\Database\\' . ucfirst($this->name) . '\\' . ucfirst($this->name) . 'Exporter';

		// Make sure we have an exporter class for this driver.
		if (!class_exists($class))
		{
			// If it doesn't exist we are at an impasse so throw an exception.
			throw new Exception\UnsupportedAdapterException('Database Exporter not found.');
		}

		/** @var $o DatabaseExporter */
		$o = new $class;
		$o->setDbo($this);

		return $o;
	}
372530
public function getContainer()
    {
        if (is_null($this->_container)) {
            $def = [
                "db_{$this->configName}" => Definition::factory(
                        function() {
                            $args = Configuration::get($this->_configFile)
                                ->get($this->_configName);
                            $adapter = new Adapter($args);
                            return $adapter->initialize();
                        }
                    ),
                'sharedEventManager' => Definition::object(
                        'Zend\EventManager\SharedEventManager'
                    )
            ];
            $this->setContainer(ContainerBuilder::buildContainer($def));
        }
        return $this->_container;
    }
1095688
public static function getDb() {
        // Get the image manager object
        $oImageManager = Yii::$app->get('imagemanager', false);

        if($oImageManager === null) {
            // The image manager object has not been set
            // The normal DB object will be returned, error will be thrown if not found
            return Yii::$app->get('db');
        }

        // The image manager component has been loaded, the DB component that has been entered will be loaded
        // By default this is the Yii::$app->db connection, the user can specify any other connection if needed
        return Yii::$app->get($oImageManager->databaseComponent);
    }
19580
public function getSQLAdapter() {
		return $this->sqlAdapter ? $this->sqlAdapter :
			($this->transactionOperationSet ? $this->transactionOperationSet->getSQLAdapter() : null);
	}
272417
protected function getAttributesFromDb()
	{
		$connection_name = Config::get('laravel-import-export::baseconf.connection_name');
		return DB::connection($connection_name)
			->table($this->config["table"])
			->select($this->createSelect() )
			->get();
	}
112999
public function getAdapter() {
		if ($this->_adapter === null) {
			if ($this->hasLocator()) {
				$this->_adapter = $this->getLocator()->get($this->getAdapterName());
			} else {
				throw new Exceptions\NoAdapter('Nor a database adapter neither a services locator has been provided');
			}
		}
		
		return $this->_adapter;
	}
973126
public function getAdapter()
    {
        /**
         * Check for an adapter being defined. if not, fetch the default adapter.
         */
        if ($this->_adapter === null) {
            $this->_adapter = Zend_Db_Table_Abstract::getDefaultAdapter();
            if (null === $this->_adapter) {

                throw new Zend_Validate_Exception('No database adapter present');
            }
        }
        return $this->_adapter;
    }
1116120
public function getAdapter()
    {
        $this->count++;
        if (is_null($this->adapter)) {
            $fss = $this->getServiceManager()->get(FileSystemService::SERVICE_ID);
            $this->adapter = $fss->getFileSystem($this->getOption('inner'))->getAdapter();
        }
        return $this->adapter;
    }
100503
protected function getDb()
    {
        return \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC);
    }
635843
public function getAdapter()
    {
        $className = $this->app->make('config')->get('antares/logger::adapter.default.model');
        return $this->app->make($className);
    }
1011185
public function connect() {
        $adapter = Zend_Db_Table::getDefaultAdapter();
        if (!$adapter) {
            Garp_Cli::errorOut('No database adapter found');
            return false;
        }
        $config = $adapter->getConfig();
        $params = array(
            '-u' . escapeshellarg($config['username']),
            '-p' . escapeshellarg($config['password']),
            '-h' . escapeshellarg($config['host']),
            ' ' . escapeshellarg($config['dbname'])
        );
        $cmd = 'mysql ' . implode(' ', $params);
        $process = proc_open($cmd, array(0 => STDIN, 1 => STDOUT, 2 => STDERR), $pipes);
        $proc_status = proc_get_status($process);
        $exit_code = proc_close($process);
        return ($proc_status["running"] ? $exit_code : $proc_status["exitcode"] ) == 0;
    }