Pdo_Ibm vs DB2 Adapter

For programming and general questions on Zend Framework

Pdo_Ibm vs DB2 Adapter

Postby awaludin on Sat Apr 21, 2012 2:47 pm

Hello..

I've got problem when trying connecting PHP with Zend_Db in AS400. first time I tried this configuration....

resources.db.adapter = "DB2"
resources.db.params.host="127.0.0.1"
resources.db.params.username = "IUSR0008"
resources.db.params.password = "RAMA1234"
resources.db.params.dbname = "V7R1DEV"
resources.db.params.port = "447"
resources.db.params.driver_options.i5_lib = "ZENDSVR"
resources.db.params.schema = "ZENDSVR"
resources.db.params.os = "i5"

and this configuration ran well

but when I tried this configuration

resources.db.adapter = "PDO_IBM"
resources.db.params.host="127.0.0.1"
resources.db.params.username = "IUSR0008"
resources.db.params.password = "RAMA1234"
resources.db.params.dbname = "V7R1DEV"
resources.db.params.port = "447"
resources.db.params.driver_options.i5_lib = "ZENDSVR"
resources.db.params.schema = "ZENDSVR"
resources.db.params.os = "i5"

got this error...

Message: SQLSTATE=42705, SQLConnect: -950 Relational database ;DATABASE=V7R1DEV; not in relational database directory.

What wrong in my PDO_IBM configuration?
awaludin
 
Posts: 17
Joined: Tue Apr 14, 2009 11:23 pm

Re: Pdo_Ibm vs DB2 Adapter

Postby formaserve on Fri Feb 01, 2013 9:54 am

do you have an entry in wrkrdbdire on your system?
formaserve
 
Posts: 66
Joined: Mon Mar 23, 2009 11:11 am

Re: Pdo_Ibm vs DB2 Adapter

Postby kim4940 on Mon Mar 13, 2017 4:00 pm

Did this ever get resolved? We are experiencing the same issue, and I wonder if it is a configuration issue with PDO.
kim4940
 
Posts: 8
Joined: Wed Jul 22, 2015 8:23 pm

Re: Pdo_Ibm vs DB2 Adapter

Postby kim4940 on Mon Mar 13, 2017 5:05 pm

This is the code I'm using:

Code: Select all
$dbServer = "WIASP1";
$dbLib = "WEBUSER";
$ipAddress = "192.168.101.4";
$connStr = "ibm:DATABASE={$dbServer};HOSTNAME={$ipaddress};PORT=446;PROTOCOL=TCPIP;";
$options = [
PDO::ATTR_PERSISTENT => false, // also fails with Persistent enabled
PDO::ATTR_ERRMODE => PDO::ERRMODE_WARNING, // or ERRMODE_EXCEPTION
];

try {
$conn = new PDO($connStr, null, null, $options); // uses QTMHHTTP Default user
} catch (PDOException $e) {
die("Connection error: ".$e->getMessage());
}

$query = "SELECT * FROM $dbLib.PWEBLOG";
$stmt = $conn->prepare($query);

if ($stmt) {
if ($stmt->execute()) {
if (($row = $stmt->fetch(PDO::FETCH_ASSOC)) !== false) {
// Successful query
var_dump($row);
}
}
}


The error I get is Connection error: SQLSTATE=42705, SQLConnect: -950 Relational database DATABASE=WIASP1;HO not in relational database directory.

Any ideas? I've run the command WRKRDBDIRE, and remote IBMi WIASP1 is in the list of relational database directory entries.
kim4940
 
Posts: 8
Joined: Wed Jul 22, 2015 8:23 pm


Return to Zend Framework

Who is online

Users browsing this forum: No registered users and 2 guests

cron