Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

db2_close(3) [php man page]

DB2_CLOSE(3)								 1							      DB2_CLOSE(3)

db2_close - Closes a database connection

SYNOPSIS
bool db2_close (resource $connection) DESCRIPTION
This function closes a DB2 client connection created with db2_connect(3) and returns the corresponding resources to the database server. If you attempt to close a persistent DB2 client connection created with db2_pconnect(3), the close request is ignored and the persistent DB2 client connection remains available for the next caller. PARAMETERS
o $connection - Specifies an active DB2 client connection. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 Closing a connection The following example demonstrates a successful attempt to close a connection to an IBM DB2, Cloudscape, or Apache Derby database. <?php $conn = db2_connect('SAMPLE', 'db2inst1', 'ibmdb2'); $rc = db2_close($conn); if ($rc) { echo "Connection was successfully closed."; } ?> The above example will output: Connection was successfully closed. SEE ALSO
db2_connect(3), db2_pclose(3), db2_pconnect(3). PHP Documentation Group DB2_CLOSE(3)

Check Out this Related Man Page

DB2_CONN_ERROR(3)							 1							 DB2_CONN_ERROR(3)

db2_conn_error - Returns a string containing the SQLSTATE returned by the last connection attempt

SYNOPSIS
string db2_conn_error ([resource $connection]) DESCRIPTION
db2_conn_error(3) returns an SQLSTATE value representing the reason the last attempt to connect to a database failed. As db2_connect(3) returns FALSE in the event of a failed connection attempt, you do not pass any parameters to db2_conn_error(3) to retrieve the SQLSTATE value. If, however, the connection was successful but becomes invalid over time, you can pass the $connection parameter to retrieve the SQLSTATE value for a specific connection. To learn what the SQLSTATE value means, you can issue the following command at a DB2 Command Line Processor prompt: db2 '? $sqlstate- value'. You can also call db2_conn_errormsg(3) to retrieve an explicit error message and the associated SQLCODE value. PARAMETERS
o $connection - A connection resource associated with a connection that initially succeeded, but which over time became invalid. RETURN VALUES
Returns the SQLSTATE value resulting from a failed connection attempt. Returns an empty string if there is no error associated with the last connection attempt. EXAMPLES
Example #1 Retrieving an SQLSTATE value for a failed connection attempt The following example demonstrates how to return an SQLSTATE value after deliberately passing invalid parameters to db2_connect(3). <?php $conn = db2_connect('badname', 'baduser', 'badpassword'); if (!$conn) { print "SQLSTATE value: " . db2_conn_error(); } ?> The above example will output: SQLSTATE value: 08001 SEE ALSO
db2_conn_errormsg(3), db2_connect(3), db2_stmt_error(3), db2_stmt_errormsg(3). PHP Documentation Group DB2_CONN_ERROR(3)
Man Page

15 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

A Terminal Dilemma

Hi everyone, I hope this is the right place to ask this question... I have a contract to convert a mainframe/DB2 application to using AIX/Oracle. Everything went fine but we are now running into a terminal problem. With the Mainframe app, the clients had great response time from remote... (5 Replies)
Discussion started by: rocky_triton
5 Replies

2. UNIX for Dummies Questions & Answers

Urgent help needed

Hi I am using DB2 as the database and i am reading syscat.columns from the database. I want to manipulate the rows returned by running SQL query from the shell script. The manipulation involves addition and deletion of the rows from the resultset. All the above i want to do using SQL... (5 Replies)
Discussion started by: skyineyes
5 Replies

3. UNIX for Advanced & Expert Users

reporting NS-12564 error as ORA-12564

Hi My client connection to RAC Oracle Release 10.2.0.4.0 database suddenly stopped working. ACPT_1 - works but not with OEM. ACPT_2 - does not work at all. Getting error ORA-12564: TNS:connection refused Any ideas very much appreciated Thanks ACPT_1 = (DESCRIPTION = ... (4 Replies)
Discussion started by: zam
4 Replies

4. UNIX for Advanced & Expert Users

Causes of high runq-sz and cswch/s output from sar

Hi folks, I'm running RHEL4 (2.6.9 - 64 bit) on a 4 CPU Dual Core Xeon. This server is running DB2 database. I've been getting the following readings from sar over the past week: 09:35:01 AM cswch/s 09:40:01 AM 4774.95 09:45:01 AM 27342.76 09:50:02 AM 196015.02 09:55:01 AM... (8 Replies)
Discussion started by: fulat2k
8 Replies

5. Shell Programming and Scripting

Compare files

I'm fairly new to UNIX... I have a file which has data.. POUND EURO DOLLAR .... ..... I need to compare all the entries of this file with the output i get out of a select query in DB2 This also has a lot of entries... Should i make another file with the DB2 output and compare... (5 Replies)
Discussion started by: Lincy
5 Replies

6. Shell Programming and Scripting

How to connect with oracle database using unix...

Hi all I am working in datawarehouse project and use DB2 database . shell scripting is written to connect with DB2 database in my application but i dont know how to connect with oracle databse or other databases.Is there any command in unix to connect any of these datbases? (6 Replies)
Discussion started by: vijays3
6 Replies

7. AIX

IBM DB2 Product Suite

Can anyone have any idea on IBM DB2 Product suite??? (4 Replies)
Discussion started by: dinesh1985
4 Replies

8. AIX

DB2 high CPU

Hello dear friends, I have Lpar AIX 6.1 and there is DB2 installed. I have 8 Virtual CPU's configured on my Lpar and when I run nmon the CPU waiting time is always big.. I will provide screenshot for better realizing.. my question is what may produce so big waiting time?? Thanks in advance! (19 Replies)
Discussion started by: Vit0_Corleone
19 Replies

9. Shell Programming and Scripting

Error: SQL3100W while export in DB2

Problem has been resolved (7 Replies)
Discussion started by: ustechie
7 Replies

10. UNIX for Advanced & Expert Users

Find common Strings in two large files

Hi , I have a text file in the format DB2: DB2: WB: WB: WB: WB: and a second text file of the format Time=00:00:00.473 Time=00:00:00.436 Time=00:00:00.016 Time=00:00:00.027 Time=00:00:00.471 Time=00:00:00.436 the last string in both the text files is of the... (4 Replies)
Discussion started by: kanthrajgowda
4 Replies

11. HP-UX

Connection closed by foreign host

I am trying to connect to my HP server from remote machine. It gets connected but once credential are provided the connection is closed. adroit:/home/seo/hitendra 32 ] telnet myserv1 Trying... Connected to myserv1. Escape character is '^]'. Local flow control on Telnet TERMINAL-SPEED... (4 Replies)
Discussion started by: hiten.r.chauhan
4 Replies

12. AIX

Asynchronous I/O on AIX and DB performance

Hi, I would like to hear your thoughts about this. We are running our Data warehouse on DB2 DPF (partition environment) and I have notice that sometimes we hit the Asynchronous-I/O-Processes peak. DB2 relies heavily on Asynchronous I/O so I would believe this has an negative impact.We are... (10 Replies)
Discussion started by: arizah
10 Replies

13. Shell Programming and Scripting

Read parameter file in a shell script to unload a DB2 Table???

Hi , I Have following requirement: DB2 Sql query to pass from a parameter file for example, I would create a parameter file with (SELECT column 1, column 2 FROM Table name) then job would read it and create a file with the contents named table.txt How to write/modify below ksh script to... (10 Replies)
Discussion started by: developer.dwh9
10 Replies

14. Shell Programming and Scripting

Dynamic case creation based on output list from a command

I am attempting to create a script that would allow me to list all the instances associated with a DB2 and then prompt the user to choose which one to issue the db2profile command against. I use the db2 command db2ilist to get a list of the instances for a particular server, but the number of... (7 Replies)
Discussion started by: slatoms
7 Replies

15. AIX

Not able to receive emails after job execution

Hi, we've configured mail on DB2 data studio DSWC console. (gave mail relay server details) it used to work fine. like whenever we schedule backup jobs from DB2 side, we used to get emails after job completion. for some reason, it stopped working now. Please see the below info messges... (8 Replies)
Discussion started by: aaron8667
8 Replies