Yii Framework Forum: Use Yii with DB2 on Windows - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Use Yii with DB2 on Windows Rate Topic: -----

#1 User is offline   corvus 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 21
  • Joined: 02-September 10

Posted 08 June 2011 - 08:39 AM

Hi!

Small info how you can connect to a IBM DB2 Database on Windows with Yii.

1) Check if you have enabled PDO_ODBC (with phpinfo or in your php.ini)
2) Make a System-DSN Settings for your DB2 Database (if not already existing)
3) 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)
0

#2 User is offline   Denis Roussel 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 36
  • Joined: 28-October 11

Posted 01 December 2011 - 05:25 AM

View Postcorvus, on 08 June 2011 - 08:39 AM, said:

Hi!

Small info how you can connect to a IBM DB2 Database on Windows with Yii.

1) Check if you have enabled PDO_ODBC (with phpinfo or in your php.ini)
2) Make a System-DSN Settings for your DB2 Database (if not already existing)
3) 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
0

#3 User is offline   Edgard Messias 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 19
  • Joined: 05-December 12
  • Location:Brazil

Posted 28 February 2013 - 11:24 AM

My extension for IBM DB2: YiiDB2
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users