mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-19 14:22:43 +08:00
113 lines
5.0 KiB
HTML
113 lines
5.0 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||
<html>
|
||
<head>
|
||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||
<title>Closes a persistent database connection</title>
|
||
</head>
|
||
<body class="docs"><div id="layout">
|
||
<div id="layout-content"><div id="function.db2-pclose" class="refentry">
|
||
<div class="refnamediv">
|
||
<h1 class="refname">db2_pclose</h1>
|
||
<p class="verinfo">(PECL ibm_db2 >= 1.8.0)</p><p class="refpurpose"><span class="refname">db2_pclose</span> — <span class="dc-title">Closes a persistent database connection</span></p>
|
||
|
||
</div>
|
||
|
||
<div class="refsect1 description" id="refsect1-function.db2-pclose-description">
|
||
<h3 class="title">说明</h3>
|
||
<div class="methodsynopsis dc-description">
|
||
<span class="methodname"><strong>db2_pclose</strong></span>
|
||
( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$resource</code></span>
|
||
) : <span class="type">bool</span></div>
|
||
|
||
<p class="para rdfs-comment">
|
||
This function closes a DB2 client connection created with
|
||
<span class="function"><a href="db2_pconnect.html" class="function">db2_pconnect()</a></span> and returns the corresponding resources
|
||
to the database server.
|
||
<blockquote class="note"><p><strong class="note">Note</strong>:
|
||
<p class="para">
|
||
This function is only available on i5/OS in response to i5/OS system
|
||
administration requests.
|
||
</p>
|
||
</p></blockquote>
|
||
</p>
|
||
<p class="para">
|
||
If you have a persistent DB2 client connection created with
|
||
<span class="function"><a href="db2_pconnect.html" class="function">db2_pconnect()</a></span>, you may use this function to close the
|
||
connection. To avoid substantial connection performance penalties, this
|
||
function should only be used in rare cases when the persistent connection
|
||
has become unresponsive or the persistent connection will not be needed for
|
||
a long period of time.
|
||
</p>
|
||
</div>
|
||
|
||
|
||
<div class="refsect1 parameters" id="refsect1-function.db2-pclose-parameters">
|
||
<h3 class="title">参数</h3>
|
||
<p class="para">
|
||
<dl>
|
||
|
||
|
||
<dt>
|
||
<code class="parameter">connection</code></dt>
|
||
|
||
<dd>
|
||
|
||
<p class="para">
|
||
Specifies an active DB2 client connection.
|
||
</p>
|
||
</dd>
|
||
|
||
|
||
</dl>
|
||
|
||
</p>
|
||
</div>
|
||
|
||
|
||
<div class="refsect1 returnvalues" id="refsect1-function.db2-pclose-returnvalues">
|
||
<h3 class="title">返回值</h3>
|
||
<p class="para">
|
||
成功时返回 <strong><code>TRUE</code></strong>, 或者在失败时返回 <strong><code>FALSE</code></strong>。
|
||
</p>
|
||
</div>
|
||
|
||
|
||
<div class="refsect1 examples" id="refsect1-function.db2-pclose-examples">
|
||
<h3 class="title">范例</h3>
|
||
<p class="para">
|
||
<div class="example" id="example-1267">
|
||
<p><strong>Example #1 Closing a persistent connection</strong></p>
|
||
<div class="example-contents"><p>
|
||
The following example demonstrates a successful attempt to close a
|
||
connection to an IBM DB2 i5/OS database.
|
||
</p></div>
|
||
<div class="example-contents">
|
||
<div class="phpcode"><pre><span style="color: #000000">
|
||
<span style="color: #0000BB"><?php<br />$conn </span><span style="color: #007700">= </span><span style="color: #0000BB">db2_pconnect</span><span style="color: #007700">(</span><span style="color: #DD0000">''</span><span style="color: #007700">, </span><span style="color: #DD0000">''</span><span style="color: #007700">, </span><span style="color: #DD0000">''</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$rc </span><span style="color: #007700">= </span><span style="color: #0000BB">db2_pclose</span><span style="color: #007700">(</span><span style="color: #0000BB">$conn</span><span style="color: #007700">);<br />if (</span><span style="color: #0000BB">$rc</span><span style="color: #007700">) {<br /> echo </span><span style="color: #DD0000">"Connection was successfully closed."</span><span style="color: #007700">;<br />}<br /></span><span style="color: #0000BB">?></span>
|
||
</span>
|
||
</pre></div>
|
||
</div>
|
||
|
||
<div class="example-contents"><p>以上例程会输出:</p></div>
|
||
<div class="example-contents screen">
|
||
<div class="cdata"><pre>
|
||
Connection was successfully closed.
|
||
</pre></div>
|
||
</div>
|
||
</div>
|
||
</p>
|
||
</div>
|
||
|
||
|
||
<div class="refsect1 seealso" id="refsect1-function.db2-pclose-seealso">
|
||
<h3 class="title">参见</h3>
|
||
<p class="para">
|
||
<ul class="simplelist">
|
||
<li class="member"><span class="function"><a href="db2_close.html" class="function" rel="rdfs-seeAlso">db2_close()</a> - Closes a database connection</span></li>
|
||
<li class="member"><span class="function"><a href="db2_pconnect.html" class="function" rel="rdfs-seeAlso">db2_pconnect()</a> - Returns a persistent connection to a database</span></li>
|
||
</ul>
|
||
</p>
|
||
</div>
|
||
|
||
|
||
</div></div></div></body></html> |