예제 #1
0
 /**
  * {@inheritDoc}
  */
 public function getCurrentSchema()
 {
     if (!$this->isConnected()) {
         $this->connect();
     }
     $info = db2_server_info($this->resource);
     return isset($info->DB_NAME) ? $info->DB_NAME : '';
 }
예제 #2
0
 /**
  * @return string
  */
 public function getQuoteIdentifierSymbol()
 {
     $this->_connect();
     $info = db2_server_info($this->_connection);
     $identQuote = $info->IDENTIFIER_QUOTE_CHAR;
     return $identQuote;
 }
예제 #3
0
 /**
  * Retrieve server version in PHP style
  *
  * @return string
  */
 public function getServerVersion()
 {
     $this->_connect();
     $server_info = db2_server_info($this->_connection);
     if ($server_info !== false) {
         $version = $server_info->DBMS_VER;
         if ($this->_isI5) {
             $version = (int) substr($version, 0, 2) . '.' . (int) substr($version, 2, 2) . '.' . (int) substr($version, 4);
         }
         return $version;
     } else {
         return null;
     }
 }
예제 #4
0
 /**
  * @return string Version information from the database
  */
 public function getServerVersion()
 {
     $info = db2_server_info($this->mConn);
     return $info->DBMS_VER;
 }
예제 #5
0
 /**
  * Quotes an identifier.
  *
  * @param string $ident The identifier.
  * 
  * @return string The quoted identifier.
  */
 public function quoteIdentifier($string)
 {
     $info = db2_server_info($this->_connection);
     $identQuote = $info->IDENTIFIER_QUOTE_CHAR;
     return $identQuote . $string . $identQuote;
 }
예제 #6
0
 public function getDbInfo()
 {
     $this->getDatabase();
     $server = @db2_server_info($this->database);
     if (is_object($server)) {
         $server = get_object_vars($server);
     } else {
         $server = null;
     }
     $client = @db2_client_info($this->database);
     if (is_object($client)) {
         $client = get_object_vars($client);
     } else {
         $client = null;
     }
     return array("IBM DB2 Client Info" => $client, "IBM DB2 Server Info" => $server);
 }
예제 #7
0
 public function getSchema()
 {
     $server = db2_server_info($this->_db->getConnection());
     return $server->DB_NAME;
 }
예제 #8
0
파일: Ibm_db2.php 프로젝트: nosch/phpMyFAQ
 /**
  * This function returns the version string.
  *
  * @access  public
  * @author  Thorsten Rinne <*****@*****.**>
  * @since   2005-04-16
  */
 function server_version()
 {
     $server = db2_server_info($this->conn);
     $ver = $server->DBMS_NAME . ' ' . $server->DBMS_VER;
     return $ver;
 }
예제 #9
0
 public static function getPrimaryKey($table, $conn, $dbtype)
 {
     /**
      * Discover metadata information about this table.
      */
     $server_info = db2_server_info($conn);
     // $server_info->DBMS_NAME == "QSQ" is iSeries / i5
     if ($server_info->DBMS_NAME == "QSQ") {
         $sql = "SELECT column_name as colname FROM qsys2.syskeycst ";
         $sql .= "WHERE system_table_name = '" . $table . "' and ordinal_position > 0 order by ordinal_position asc";
     } else {
         $sql = "SELECT colname FROM SYSCAT.COLUMNS WHERE TABNAME = '" . $table . "' AND KEYSEQ > 0 ORDER BY KEYSEQ ASC";
     }
     $rs = self::query($conn, $sql);
     if ($rs) {
         $res = self::fetch_num($rs);
         self::closeCursor($rs);
         if ($res) {
             return $res[0];
         }
     }
     return false;
 }