YiiDB2 ¶
Support the DB2 database in Yii Framework
Requirements ¶
- PHP module pdo_ibm; (for ibm_pdo, see GitHub)
- DB2 Client installed
Version ¶
- For pdo_ibm or pdo_odbc, use yiidb2-*.zip
- For ibm_db2, use yiidb2-ibm_db2-*.zip
Installation ¶
- Install yiidb2 extension
- Extract the release file under
protected/extensions
- In your
protected/config/main.php
, add the following:
<?php
...
'components' => array(
...
'db' => array(
'connectionString' => 'ibm:DRIVER={IBM DB2 ODBC DRIVER};DATABASE=database;HOSTNAME=hostname;PORT=port;PROTOCOL=TCPIP;',
'username' => 'username',
'password' => 'password',
'class' => 'ext.yiidb2.CIbmDB2Connection',
),
...
),
...
I can't connect to db2 (iseries).
I have tried to connect to iseries but It dose not work.
perhaps I have something setting wrong.
when I have tried to use this code is below
'db' => array(
'connectionString' => 'ibm:DRIVER={IBM DB2 ODBC DRIVER};DATABASE=database;HOSTNAME=hostname;PORT=port;PROTOCOL=TCPIP;', 'username' => 'username', 'password' => 'password', 'class' => 'ext.yiidb2.CIbmDB2Connection', ),
I have get error message is below
CDbCommand failed to prepare the SQL statement: SQLSTATE[42S02]: Base table or view not found: 0 [IBM][System i Access ODBC Driver][DB2 for i5/OS]SQL7967 - PREPARE of statement COLUMNS completed. (SQLPrepare[0] at ext\pdo_odbc\odbc_driver.c:206)
but when I have tried to use this code is below
'db' => array(
'connectionString' => 'odbc:Driver={Client Access ODBC Driver (32-bit)};System=PUTSERVERNAMEHERE;DATABASE=PUTSCHEMAHERE;UID=PUTUSERHERE;PWD=PUTPASSWORDHERE;',
'class' => 'ext.yiidb2.CIbmDB2Connection',
the error message is below
CDbConnection failed to open the DB connection: SQLSTATE=42968, SQLDriverConnect: -1598 [IBM][CLI Driver] SQL1598N An attempt to connect to the database server failed because of a licensing problem. SQLSTATE=42968
how can I do it.
Thanks in advance for your advice.
Added support for DB2 iSeries
Added support for DB2 iSeries.
Follow in GitHub.
Thanks.
It 's very nice.
Thanks so much.
How we can use the extension in yii2
How we can use the extension in yii2.
Thank you.
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.