П О Р Т А Л                            
С Е Т Е В Ы Х                          
П Р О Е К Т О В                        
  
Поиск по сайту:
                                                 
Главная

О проекте

Web-мастеру
     HTML & JavaScript
     SSI
     Perl
     PHP
     XML & XSLT
     Unix Shell

MySQL

Безопасность

Хостинг

Другое








Самое читаемое:

Учебник PHP - "Для Чайника".
Просмотров 3409 раз(а).

Иллюстрированный самоучитель по созданию сайтов.
Просмотров 5958 раз(а).

Учебник HTML.
Просмотров 3204 раз(а).

Руководство по PHP5.
Просмотров 5420 раз(а).

Хостинг через призму DNS.
Просмотров 4018 раз(а).

Подборка текстов стандартных документов.
Просмотров 55710 раз(а).

Учебник PHP - Самоучитель
Просмотров 2996 раз(а).

Документация на MySQL (учебник & справочное руководство)
Просмотров 4573 раз(а).

Внешние атаки...
Просмотров 3732 раз(а).

Учебник PHP.
Просмотров 2767 раз(а).

SSI в примерах.
Просмотров 37384 раз(а).



 
 
| Добавить в избранное | Сделать стартовой | Помощь





Руководство по PHP
Пред. След.

db2_pconnect

(PECL)

db2_pconnect --  Returns a persistent connection to a database

Описание

resource db2_pconnect ( string database, string username, string password [, array options] )

Returns a persistent connection to an IBM DB2 Universal Database, IBM Cloudscape, or Apache Derby database. For more information on persistent connections, refer to Гл. 41.

Calling db2_close() on a persistent connection always returns TRUE, but the underlying DB2 client connection remains open and waiting to serve the next matching db2_pconnect() request.

Note that you are strongly urged to only use persistent connections on connections with autocommit turned on. If you attempt to combine transactions with persistent connections, issuing db2_commit() or db2_rollback() against a persistent connection will affect every persistent connection that is currently using the same underlying DB2 client connection. You may also rapidly experience locking escalation if you do not use autocommit for your persistent connections.

Список параметров

database

The database alias in the DB2 client catalog.

username

The username with which you are connecting to the database.

password

The password with which you are connecting to the database.

options

An associative array of connection options that affect the behavior of the connection, where valid array keys include:

autocommit

Passing the DB2_AUTOCOMMIT_ON value turns autocommit on for this connection handle.

Passing the DB2_AUTOCOMMIT_OFF value turns autocommit off for this connection handle.

Возвращаемые значения

Returns a connection handle resource if the connection attempt is successful. db2_pconnect() tries to reuse an existing connection resource that exactly matches the database, username, and password parameters. If the connection attempt fails, db2_pconnect() returns FALSE.

Примеры

Пример 1. A db2_pconnect() example

In the following example, the first call to db2_pconnect() returns a new persistent connection resource. The second call to db2_pconnect() returns a persistent connection resource that simply reuses the first persistent connection resource.

<?php
$database
= 'SAMPLE';
$user = 'db2inst1';
$password = 'ibmdb2';

$pconn = db2_pconnect($database, $user, $password);

if (
$pconn) {
    echo
"Persistent connection succeeded.";
}
else {
    echo
"Persistent connection failed.";
}

$pconn2 = db2_pconnect($database, $user, $password);
if (
$pconn) {
    echo
"Second persistent connection succeeded.";
}
else {
    echo
"Second persistent connection failed.";
}
?>

Результат выполнения данного примера:

Persistent connection succeeded.
Second persistent connection succeeded.

Смотрите также

db2_connect()



Если Вы не нашли что искали, то рекомендую воспользоваться поиском по сайту:
 





Copyright © 2005-2016 Project.Net.Ru