コード例 #1
0
ファイル: Pgsql.php プロジェクト: hjr3/zf2
 /**
  * Creates a PDO object and connects to the database.
  *
  * @return void
  * @throws \Zend\DB\Adapter\Exception
  */
 protected function _connect()
 {
     if ($this->_connection) {
         return;
     }
     parent::_connect();
     if (!empty($this->_config['charset'])) {
         $sql = "SET NAMES '" . $this->_config['charset'] . "'";
         $this->_connection->exec($sql);
     }
 }
コード例 #2
0
ファイル: Mssql.php プロジェクト: hjr3/zf2
 /**
  * @return void
  */
 protected function _connect()
 {
     if ($this->_connection) {
         return;
     }
     parent::_connect();
     $this->_connection->exec('SET QUOTED_IDENTIFIER ON');
 }