Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > by-pkgid > 05cd670d8a02b2b4a0ffb1756f2e8308 > files > 5800

php-manual-zh-5.2.4-1mdv2008.1.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>db2_client_info</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REL="HOME"
TITLE="PHP 手册"
HREF="index.html"><LINK
REL="UP"
TITLE="IBM DB2, Cloudscape and Apache Derby Functions"
HREF="ref.ibm-db2.html"><LINK
REL="PREVIOUS"
TITLE="db2_bind_param"
HREF="function.db2-bind-param.html"><LINK
REL="NEXT"
TITLE="db2_close"
HREF="function.db2-close.html"><META
HTTP-EQUIV="Content-type"
CONTENT="text/html; charset=UTF-8"></HEAD
><BODY
CLASS="refentry"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>PHP 手册</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="function.db2-bind-param.html"
ACCESSKEY="P"
>上一页</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="function.db2-close.html"
ACCESSKEY="N"
>下一页</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="function.db2-client-info"
></A
>db2_client_info</H1
><DIV
CLASS="refnamediv"
><A
NAME="AEN79571"
></A
><P
>    (no version information, might be only in CVS)</P
>db2_client_info&nbsp;--&nbsp;Returns an object with properties that describe the DB2 database client</DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN79574"
></A
><H2
>说明</H2
>object <B
CLASS="methodname"
>db2_client_info</B
> ( resource connection )<BR
></BR
><P
>&#13;   This function returns an object with read-only properties that return
   information about the DB2 database client. The following table lists
   the DB2 client properties:
   <DIV
CLASS="table"
><A
NAME="AEN79583"
></A
><P
><B
>表 1. DB2 client properties</B
></P
><TABLE
BORDER="1"
CLASS="CALSTABLE"
><COL><COL><COL><THEAD
><TR
><TH
>Property name</TH
><TH
>Return type</TH
><TH
>Description</TH
></TR
></THEAD
><TBODY
><TR
><TD
>APPL_CODEPAGE</TD
><TD
>int</TD
><TD
>The application code page.</TD
></TR
><TR
><TD
>CONN_CODEPAGE</TD
><TD
>int</TD
><TD
>The code page for the current connection.</TD
></TR
><TR
><TD
>DATA_SOURCE_NAME</TD
><TD
>string</TD
><TD
>The data source name (DSN) used to create the current connection
        to the database.</TD
></TR
><TR
><TD
>DRIVER_NAME</TD
><TD
>string</TD
><TD
>The name of the library that implements the DB2 Call
        Level Interface (CLI) specification.</TD
></TR
><TR
><TD
>DRIVER_ODBC_VER</TD
><TD
>string</TD
><TD
>The version of ODBC that the DB2 client supports. This returns a
        string "MM.mm" where <CODE
CLASS="varname"
>MM</CODE
> is the major version and
        <CODE
CLASS="varname"
>mm</CODE
> is the minor version. The DB2 client always
        returns "03.51".
       </TD
></TR
><TR
><TD
>DRIVER_VER</TD
><TD
>string</TD
><TD
>The version of the client, in the form of a string "MM.mm.uuuu" where
        <CODE
CLASS="varname"
>MM</CODE
> is the major version, 
        <CODE
CLASS="varname"
>mm</CODE
> is the minor version,
        and <CODE
CLASS="varname"
>uuuu</CODE
> is the update. For example, "08.02.0001"
        represents major version 8, minor version 2, update 1.
       </TD
></TR
><TR
><TD
>ODBC_SQL_CONFORMANCE</TD
><TD
>string</TD
><TD
>The level of ODBC SQL grammar supported by the client:
        <P
></P
><DIV
CLASS="variablelist"
><DL
><DT
>MINIMUM</DT
><DD
><P
>&#13;            Supports the minimum ODBC SQL grammar.
           </P
></DD
><DT
>CORE</DT
><DD
><P
>&#13;            Supports the core ODBC SQL grammar.
           </P
></DD
><DT
>EXTENDED</DT
><DD
><P
>&#13;            Supports extended ODBC SQL grammar.
           </P
></DD
></DL
></DIV
>
       </TD
></TR
><TR
><TD
>ODBC_VER</TD
><TD
>string</TD
><TD
>The version of ODBC that the ODBC driver manager supports. This
        returns a string "MM.mm.rrrr" where <CODE
CLASS="varname"
>MM</CODE
> is the major
        version, <CODE
CLASS="varname"
>mm</CODE
> is the minor version, and
        <CODE
CLASS="varname"
>rrrr</CODE
> is the release. The DB2 client always returns
        "03.01.0000".
       </TD
></TR
></TBODY
></TABLE
></DIV
>
  </P
></DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN79645"
></A
><H2
>参数</H2
><P
>&#13;   <P
></P
><DIV
CLASS="variablelist"
><DL
><DT
><CODE
CLASS="parameter"
>connection</CODE
></DT
><DD
><P
>&#13;       Specifies an active DB2 client connection.
      </P
></DD
></DL
></DIV
>
  </P
></DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN79654"
></A
><H2
>返回值</H2
><P
>&#13;   Returns an object on a successful call. Returns <TT
CLASS="constant"
><B
>FALSE</B
></TT
> on failure.
  </P
></DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN79658"
></A
><H2
>范例</H2
><P
>&#13;   <TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
CLASS="EXAMPLE"
><TR
><TD
><DIV
CLASS="example"
><A
NAME="AEN79661"
></A
><P
><B
>例 1. A <B
CLASS="function"
>db2_client_info()</B
> example</B
></P
><P
>&#13;     To retrieve information about the client, you must pass a valid
     database connection resource to <B
CLASS="function"
>db2_client_info()</B
>.
    </P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
CELLPADDING="5"
><TR
><TD
><code><font color="#000000">
<font color="#0000BB">&lt;?php<br />$conn </font><font color="#007700">= </font><font color="#0000BB">db2_connect</font><font color="#007700">( </font><font color="#DD0000">'SAMPLE'</font><font color="#007700">, </font><font color="#DD0000">'db2inst1'</font><font color="#007700">, </font><font color="#DD0000">'ibmdb2' </font><font color="#007700">);<br /></font><font color="#0000BB">$client </font><font color="#007700">= </font><font color="#0000BB">db2_client_info</font><font color="#007700">( </font><font color="#0000BB">$conn </font><font color="#007700">);<br /><br />if (</font><font color="#0000BB">$client</font><font color="#007700">) {<br />&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">"DRIVER_NAME: "</font><font color="#007700">; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">var_dump</font><font color="#007700">( </font><font color="#0000BB">$client</font><font color="#007700">-&gt;</font><font color="#0000BB">DRIVER_NAME </font><font color="#007700">);&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">"DRIVER_VER: "</font><font color="#007700">; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">var_dump</font><font color="#007700">( </font><font color="#0000BB">$client</font><font color="#007700">-&gt;</font><font color="#0000BB">DRIVER_VER </font><font color="#007700">);&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">"DATA_SOURCE_NAME: "</font><font color="#007700">; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">var_dump</font><font color="#007700">( </font><font color="#0000BB">$client</font><font color="#007700">-&gt;</font><font color="#0000BB">DATA_SOURCE_NAME </font><font color="#007700">);&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">"DRIVER_ODBC_VER: "</font><font color="#007700">; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">var_dump</font><font color="#007700">( </font><font color="#0000BB">$client</font><font color="#007700">-&gt;</font><font color="#0000BB">DRIVER_ODBC_VER </font><font color="#007700">);&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">"ODBC_VER: "</font><font color="#007700">; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">var_dump</font><font color="#007700">( </font><font color="#0000BB">$client</font><font color="#007700">-&gt;</font><font color="#0000BB">ODBC_VER </font><font color="#007700">);&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">"ODBC_SQL_CONFORMANCE: "</font><font color="#007700">; &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">var_dump</font><font color="#007700">( </font><font color="#0000BB">$client</font><font color="#007700">-&gt;</font><font color="#0000BB">ODBC_SQL_CONFORMANCE </font><font color="#007700">);&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">"APPL_CODEPAGE: "</font><font color="#007700">; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">var_dump</font><font color="#007700">( </font><font color="#0000BB">$client</font><font color="#007700">-&gt;</font><font color="#0000BB">APPL_CODEPAGE </font><font color="#007700">);&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">"CONN_CODEPAGE: "</font><font color="#007700">; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">var_dump</font><font color="#007700">( </font><font color="#0000BB">$client</font><font color="#007700">-&gt;</font><font color="#0000BB">CONN_CODEPAGE </font><font color="#007700">);&nbsp;&nbsp;&nbsp;&nbsp; <br />}<br />else {<br />&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">"Error retrieving client information.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Perhaps your database connection was invalid."</font><font color="#007700">;<br />}<br /></font><font color="#0000BB">db2_close</font><font color="#007700">(</font><font color="#0000BB">$conn</font><font color="#007700">);<br /><br /></font><font color="#0000BB">?&gt;</font>
</font>
</code></TD
></TR
></TABLE
><P
>上例将输出:</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
CELLPADDING="5"
><TR
><TD
><PRE
CLASS="screen"
>DRIVER_NAME: string(8) "libdb2.a"
DRIVER_VER: string(10) "08.02.0001"
DATA_SOURCE_NAME: string(6) "SAMPLE"
DRIVER_ODBC_VER: string(5) "03.51"
ODBC_VER: string(10) "03.01.0000"
ODBC_SQL_CONFORMANCE: string(8) "EXTENDED"
APPL_CODEPAGE: int(819)
CONN_CODEPAGE: int(819)</PRE
></TD
></TR
></TABLE
></DIV
></TD
></TR
></TABLE
>
  </P
></DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN79669"
></A
><H2
>参见</H2
><P
>&#13;   <P
></P
><TABLE
BORDER="0"
><TBODY
><TR
><TD
><A
HREF="function.db2-server-info.html"
><B
CLASS="function"
>db2_server_info()</B
></A
></TD
></TR
></TBODY
></TABLE
><P
></P
>
  </P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="function.db2-bind-param.html"
ACCESSKEY="P"
>上一页</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>起始页</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="function.db2-close.html"
ACCESSKEY="N"
>下一页</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>db2_bind_param</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="ref.ibm-db2.html"
ACCESSKEY="U"
>上一级</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>db2_close</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>