<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.ibm-db2.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'function.db2-pclose.php',
    1 => 'db2_pclose',
    2 => 'Closes a persistent database connection',
  ),
  'up' => 
  array (
    0 => 'ref.ibm-db2.php',
    1 => 'IBM DB2 Functions',
  ),
  'prev' => 
  array (
    0 => 'function.db2-num-rows.php',
    1 => 'db2_num_rows',
  ),
  'next' => 
  array (
    0 => 'function.db2-pconnect.php',
    1 => 'db2_pconnect',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/ibm_db2/functions/db2-pclose.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.db2-pclose" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">db2_pclose</h1>
  <p class="verinfo">(PECL ibm_db2 &gt;= 1.8.0)</p><p class="refpurpose"><span class="refname">db2_pclose</span> &mdash; <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">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>db2_pclose</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> <code class="parameter">$connection</code></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   This function closes a DB2 client connection created with
   <span class="function"><a href="function.db2-pconnect.php" class="function">db2_pconnect()</a></span> and returns the corresponding resources
   to the database server.
   <blockquote class="note"><p><strong class="note">Note</strong>: 
    <span class="simpara">
     This function is only available on i5/OS in response to i5/OS system
     administration requests.
    </span>
   </p></blockquote>
  </p>
  <p class="simpara">
   If you have a persistent DB2 client connection created with
   <span class="function"><a href="function.db2-pconnect.php" 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">Parameters</h3>
  <dl>
   
    <dt><code class="parameter">connection</code></dt>
    <dd>
     <span class="simpara">
      Specifies an active DB2 client connection.
     </span>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.db2-pclose-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="simpara">
   Returns <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> on success or <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> on failure.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.db2-pclose-examples">
  <h3 class="title">Examples</h3>
  <div class="example" id="db2-pclose.example.basic">
   <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"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?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">?&gt;</span></span></code></div>
   </div>

   <div class="example-contents"><p>The above example will output:</p></div>
   <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">Connection was successfully closed.</pre>
</div>
   </div>
  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.db2-pclose-seealso">
  <h3 class="title">See Also</h3>
  <ul class="simplelist">
   <li><span class="function"><a href="function.db2-close.php" class="function" rel="rdfs-seeAlso">db2_close()</a> - Closes a database connection</span></li>
   <li><span class="function"><a href="function.db2-pconnect.php" class="function" rel="rdfs-seeAlso">db2_pconnect()</a> - Returns a persistent connection to a database</span></li>
  </ul>
 </div>


</div><?php manual_footer($setup); ?>