corvus
(Yiiframework)
1
Hi!
Small info how you can connect to a IBM DB2 Database on Windows with Yii.
-
Check if you have enabled PDO_ODBC (with phpinfo or in your php.ini)
-
Make a System-DSN Settings for your DB2 Database (if not already existing)
-
Add following code to your config file.
'db2' => array(
'class'=>'CDbConnection',
'connectionString' => 'odbc:DSN=DB2db;UID=username;PWD=password',
'emulatePrepare' => false,
'charset' => 'utf8',
),
HINT: emulatePrepare does not work, so deactivate it or delete the line!!
On Linux it should be relative similar to get a connection.
You just have to install it correctly (PDO ODBC install)
I have schema reading problem when I want to generate the model with gii.
"CDbConnection does not support reading schema for odbc database"…
Any clue?
Many thanks
My extension for IBM DB2: YiiDB2