DNS for PDO IBM

General discussion on Zend Core for IBM System i
Post Reply
mihael_schmidt
Posts: 1
Joined: Tue Jan 12, 2010 1:35 pm

DNS for PDO IBM

Post by mihael_schmidt » Wed Jan 13, 2010 11:35 am

Hi,

I'm developing an application which can have various databases as backend using PDO to connect. I had no trouble connecting to a MySQL database. But when I tried to connect to the DB2 on i I had some trouble figuring out what the connection string should be (DNS).

As PDO should be an abstraction layer I thought the connection string would have the same syntax for every database. It seems I am wrong. Using MySQL I used the following syntax:

Code: Select all

mysql:dbname=my_database;host=my_host
But that wouldn't work with the ibm driver. It seems the ibm driver expects something like:

Code: Select all

ibm:my_database
And my_database must be registered (see WRKRDBDIRE).

Is this correct? Is this anywhere documented?

Regards

Mihael

Post Reply