protected function openConnection()
    {
        // connection still closed
        if (null === $this->connection) {
            // check for dsn parameter. it is usually the ODBC identifier, e.g. VOS.
            // for more information have a look into /etc/odbc.ini (*NIX systems)
            if (false === isset($this->configuration['dsn'])) {
                throw new \Exception('Parameter dsn is not set.');
            }

            // check for username parameter
            if (false === isset($this->configuration['username'])) {
                throw new \Exception('Parameter username is not set.');
            }

            // check for password parameter
            if (false === isset($this->configuration['password'])) {
                throw new \Exception('Parameter password is not set.');
            }

            /*
             * Setup ODBC connection using PDO-ODBC
             */
            $this->connection = new \PDO(
                'odbc:'.(string) $this->configuration['dsn'],
                (string) $this->configuration['username'],
                (string) $this->configuration['password']
            );
            $this->connection->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
        }

        return $this->connection;
    }
protected function openConnection()
    {
        // connection still closed
        if (null === $this->connection) {
            // check for dsn parameter. it is usually the ODBC identifier, e.g. VOS.
            // for more information have a look into /etc/odbc.ini (*NIX systems)
            if (false === isset($this->configuration['dsn'])) {
                throw new \Exception('Parameter dsn is not set.');
            }

            // check for username parameter
            if (false === isset($this->configuration['username'])) {
                throw new \Exception('Parameter username is not set.');
            }

            // check for password parameter
            if (false === isset($this->configuration['password'])) {
                throw new \Exception('Parameter password is not set.');
            }

            /*
             * Setup ODBC connection using PDO-ODBC
             */
            $this->connection = new \PDO(
                'odbc:'.(string) $this->configuration['dsn'],
                (string) $this->configuration['username'],
                (string) $this->configuration['password']
            );
            $this->connection->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
        }

        return $this->connection;
    }
protected function openConnection ( ) { // connection still closed if ( null === $ this -> connection ) { // check for dsn parameter. it is usually the ODBC identifier, e.g. VOS. // for more information have a look into /etc/odbc.ini (*NIX systems) if ( false === isset ( $ this -> configuration [ 'dsn' ] ) ) { throw new \ Exception ( 'Parameter dsn is not set.' ) ; } // check for username parameter if ( false === isset ( $ this -> configuration [ 'username' ] ) ) { throw new \ Exception ( 'Parameter username is not set.' ) ; } // check for password parameter if ( false === isset ( $ this -> configuration [ 'password' ] ) ) { throw new \ Exception ( 'Parameter password is not set.' ) ; } /*
             * Setup ODBC connection using PDO-ODBC
             */ $ this -> connection = new \ PDO ( 'odbc:' . ( string ) $ this -> configuration [ 'dsn' ] , ( string ) $ this -> configuration [ 'username' ] , ( string ) $ this -> configuration [ 'password' ] ) ; $ this -> connection -> setAttribute ( \ PDO :: ATTR_ERRMODE , \ PDO :: ERRMODE_EXCEPTION ) ; } return $ this -> connection ; }
Returns the current connection resource. The resource is created lazily if it doesn't exist.

@return \PDO instance of \PDO representing an open PDO-ODBC connection

@throws \PDOException if connection could not be established
Returns the current connection resource . The resource is created lazily if it doesn t exist .