1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177
|
<?xml version='1.0' encoding="utf-8"?>
<!-- $Revision: 297078 $ -->
<!-- Purpose: database.vendors -->
<!-- Membership: external, pecl -->
<reference xml:id="ref.pdo-ibm" xmlns="http://docbook.org/ns/docbook">
<title>IBM Functions (PDO_IBM)</title>
<titleabbrev>IBM (PDO)</titleabbrev>
<partintro>
<section xml:id="pdo-ibm.intro">
&reftitle.intro;
<para>
PDO_IBM is a driver that implements the <link linkend="intro.pdo">PHP Data
Objects (PDO)</link> interface to enable access from PHP to IBM databases.
</para>
</section>
<!-- Information found in configure.xml -->
&reference.pdo-ibm.configure;
</partintro>
<refentry xml:id="ref.pdo-ibm.connection">
<refnamediv>
<refname>PDO_IBM DSN</refname>
<refpurpose>Connecting to IBM databases</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<para>
The PDO_IBM Data Source Name (DSN) is based on the IBM CLI DSN. The major
components of the PDO_IBM DSN are:
<variablelist>
<varlistentry>
<term>DSN prefix</term>
<listitem>
<para>
The DSN prefix is <userinput>ibm:</userinput>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>DSN</constant></term>
<listitem>
<para>
The DSN can be any of the following:
<itemizedlist>
<listitem>
<para>
a) Data source setup using <filename>db2cli.ini</filename>
or <filename>odbc.ini</filename>
</para>
</listitem>
<listitem>
<para>
b) Catalogued database name i.e. database alias in the DB2 client
catalog
</para>
</listitem>
<listitem>
<para>
c) Complete connection string in the following format:
<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>
where the parameters represent the following values:
<variablelist>
<varlistentry>
<term><parameter>database</parameter></term>
<listitem>
<para>
The name of the database.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>hostname</parameter></term>
<listitem>
<para>
The hostname or IP address of the database server.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>port</parameter></term>
<listitem>
<para>
The TCP/IP port on which the database is listening for
requests.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>username</parameter></term>
<listitem>
<para>
The username with which you are connecting to the
database.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>password</parameter></term>
<listitem>
<para>
The password with which you are connecting to the database.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</listitem>
</itemizedlist>
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>PDO_IBM DSN example using <filename>db2cli.ini</filename></title>
<para>
The following example shows a PDO_IBM DSN for connecting to an DB2
database cataloged as DB2_9 in <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 example using a connection string</title>
<para>
The following example shows a PDO_IBM DSN for connecting to an DB2
database named <userinput>testdb</userinput> using the DB2 CLI
connection string syntax.
<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
-->
|