IBM PDO Driver (PDO_IBM)
PDO_IBM is a driver that implements the PHP Data Objects (PDO) interface to enable access from PHP to IBM databases.
Intro
PDO_IBM is a driver that implements the PHP Data Objects (PDO) interface to enable access from PHP to IBM databases.
Configure Ini
PDO_IBM DSNConnecting to IBM databasesDescription The PDO_IBM Data Source Name (DSN) is based on the IBM CLI DSN. The major components of the PDO_IBM DSN are: DSN prefixThe DSN prefix is ibm:.DSNThe DSN can be any of the following: a) Data source setup using db2cli.ini or odbc.inib) Catalogued database name i.e. database alias in the DB2 client catalogc) Complete connection string in the following format: DRIVER={IBM DB2 ODBC DRIVER};DATABASE=database;HOSTNAME=hostname;PORT=port;PROTOCOL=TCPIP;UID=username;PWD=password; where the parameters represent the following values: databaseThe name of the database.hostnameThe hostname or IP address of the database server.portThe TCP/IP port on which the database is listening for requests.usernameThe username with which you are connecting to the database.passwordThe password with which you are connecting to the database.Examples PDO_IBM DSN example using db2cli.iniThe following example shows a PDO_IBM DSN for connecting to an DB2 database cataloged as DB2_9 in db2cli.ini: $db = new PDO("ibm:DSN=DB2_9", "", ""); [DB2_9] Database=testdb Protocol=tcpip Hostname=11.22.33.444 Servicename=56789PDO_IBM DSN example using a connection stringThe following example shows a PDO_IBM DSN for connecting to an DB2 database named testdb using the DB2 CLI connection string syntax. $db = new PDO("ibm:DRIVER={IBM DB2 ODBC DRIVER};DATABASE=testdb;" . "HOSTNAME=11.22.33.444;PORT=56789;PROTOCOL=TCPIP;", "testuser", "tespass");