db2_pclose

(PECL ibm_db2 >= 1.8.0)

db2_pcloseCloses a persistent database connection

说明

db2_pclose ( resource $resource ) : bool

This function closes a DB2 client connection created with db2_pconnect() and returns the corresponding resources to the database server.

Note:

This function is only available on i5/OS in response to i5/OS system administration requests.

If you have a persistent DB2 client connection created with db2_pconnect(), 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.

参数

connection

Specifies an active DB2 client connection.

返回值

成功时返回 TRUE, 或者在失败时返回 FALSE

范例

Example #1 Closing a persistent connection

The following example demonstrates a successful attempt to close a connection to an IBM DB2 i5/OS database.

<?php
$conn 
db2_pconnect('''''');
$rc db2_pclose($conn);
if (
$rc) {
    echo 
"Connection was successfully closed.";
}
?>

以上例程会输出:

Connection was successfully closed.

参见

相关文章
php ibm db2 函数 returns or sets the autocommit state for a database connectionphp ibm db2 函数 returns an object with properties that describe the db2 database clientphp ibm db2 函数 closes a database connectionphp ibm db2 函数 returns a string containing the sqlstate returned by the last connection attemptphp ibm db2 函数 returns the last connection error message and sqlcode valuephp ibm db2 函数 returns a connection to a databasephp ibm db2 函数 retrieves an option value for a statement resource or a connection resourcephp ibm db2 函数 returns the auto generated id of the last insert query that successfully executed on this connectionphp ibm db2 函数 closes a persistent database connectionphp ibm db2 函数 returns a persistent connection to a databasephp ibm db2 函数 returns a result set listing the stored procedures registered in a databasephp ibm db2 函数 returns an object with properties that describe the db2 database serverphp ibm db2 函数 set options for connection or statement resourcesphp ibm db2 函数 returns a result set listing the tables and associated privileges in a databasephp ibm db2 函数 returns a result set listing the tables and associated metadata in a databasephp firebird/interbase 函数 open a persistent connection to an interbase databasephp ingres 函数 open a persistent connection to an ingres databasephp maxdb 函数 closes a previously opened database connectionphp msql 函数 open persistent msql connectionphp odbc 函数 open a persistent database connection
关注编程学问公众号