mirror of
https://github.com/php/doc-ja.git
synced 2026-03-24 07:02:08 +01:00
180 lines
5.9 KiB
XML
180 lines
5.9 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 3c1bec9d700807df36994cf368ba291214cd424d Maintainer: takagi Status: ready -->
|
|
|
|
<reference xml:id="ref.pdo-ibm" xmlns="http://docbook.org/ns/docbook">
|
|
<?phpdoc extension-membership="pecl" ?>
|
|
<title>IBM PDO ドライバ (PDO_IBM)</title>
|
|
<titleabbrev>IBM PDO ドライバ</titleabbrev>
|
|
<partintro>
|
|
|
|
<section xml:id="pdo-ibm.intro">
|
|
&reftitle.intro;
|
|
<para>
|
|
PDO_IBM は <link linkend="intro.pdo">PHP Data
|
|
Objects (PDO)</link> インターフェイスを実装したドライバで、
|
|
PHP から IBM のデータベースにアクセスできるようになります。
|
|
</para>
|
|
</section>
|
|
|
|
<!-- Information found in configure.xml -->
|
|
&reference.pdo-ibm.configure;
|
|
<!-- Information found in ini.xml -->
|
|
&reference.pdo-ibm.ini;
|
|
|
|
</partintro>
|
|
|
|
<refentry xml:id="ref.pdo-ibm.connection">
|
|
<refnamediv>
|
|
<refname>PDO_IBM DSN</refname>
|
|
<refpurpose>IBM データベースへの接続</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<para>
|
|
PDO_IBM のデータソース名 (DSN) は、IBM CLI DSN にもとづいています。
|
|
PDO_IBM DSN は、主に以下の部分から構成されます。
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term>DSN プレフィックス</term>
|
|
<listitem>
|
|
<para>
|
|
DSN プレフィックスは <userinput>ibm:</userinput> です。
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term>DSN</term>
|
|
<listitem>
|
|
<para>
|
|
DSN は、次のうちのいずれかです。
|
|
<itemizedlist>
|
|
<listitem>
|
|
<para>
|
|
a) <filename>db2cli.ini</filename>
|
|
あるいは <filename>odbc.ini</filename> を使用したデータソースの設定
|
|
</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>
|
|
b) カタログされたデータベース名、つまり、
|
|
DB2 クライアントにおけるデータベースエイリアス
|
|
</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>
|
|
c) 完全な接続文字列。次のような形式になります。
|
|
<code>DRIVER={IBM DB2 ODBC DRIVER};DATABASE=<parameter>database</parameter>;HOSTNAME=<parameter>hostname</parameter>;PORT=<parameter>port</parameter>;PROTOCOL=TCPIP;UID=<parameter>username</parameter>;PWD=<parameter>password</parameter>;</code>
|
|
各パラメータは次の内容を表します。
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>database</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
データベースの名前。
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>hostname</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
データベースサーバーのホスト名あるいは IP アドレス。
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>port</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
データベースが要求を待ち受けている TCP/IP ポート。
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>username</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
データベースに接続する際のユーザー名。
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>password</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
データベースに接続する際のパスワード。
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</listitem>
|
|
</itemizedlist>
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title><filename>db2cli.ini</filename> を使用した PDO_IBM DSN の例</title>
|
|
<para>
|
|
この例は、PDO_IBM DSN で DB2 データベースに接続する方法を示すものです。
|
|
このデータベースは、DB2_9 という名前で <filename>db2cli.ini</filename>
|
|
にカタログされています。
|
|
<programlisting><![CDATA[
|
|
$db = new PDO("ibm:DSN=DB2_9", "", "");
|
|
|
|
[DB2_9]
|
|
Database=testdb
|
|
Protocol=tcpip
|
|
Hostname=11.22.33.444
|
|
Servicename=56789
|
|
]]></programlisting>
|
|
</para>
|
|
</example>
|
|
<example>
|
|
<title>接続文字列を使用した PDO_IBM DSN の例</title>
|
|
<para>
|
|
この例は、PDO_IBM DSN で DB2 データベースに接続する方法を示すものです。
|
|
このデータベースの名前は <userinput>testdb</userinput> で、DB2 CLI
|
|
の接続文字列構文を使用します。
|
|
<programlisting><![CDATA[
|
|
$db = new PDO("ibm:DRIVER={IBM DB2 ODBC DRIVER};DATABASE=testdb;" .
|
|
"HOSTNAME=11.22.33.444;PORT=56789;PROTOCOL=TCPIP;", "testuser", "tespass");
|
|
]]>
|
|
</programlisting>
|
|
</para>
|
|
</example>
|
|
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
</reference>
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|