edgardmessias / yii2-ibm-db2

This extension adds IBM DB2 database engine extension for the Yii framework 2.0.
Other
7 stars 6 forks source link

IBM DB2 Extension for Yii 2 (yii2-ibm-db2)

Latest Stable Version Total Downloads Latest Unstable Version License

This extension adds IBM DB2 database engine extension for the Yii framework 2.0.

This branch use the last developer version of Yii2 (dev-master)

Yii2 Build Status Dependency Status Reference Status Code Coverage Scrutinizer Code Quality

Requirements

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist "edgardmessias/yii2-ibm-db2:*"

or add

"edgardmessias/yii2-ibm-db2": "*"

to the require section of your composer.json.

Configuration

To use this extension, simply add the following code in your application configuration:

Using IBM DB2:

return [
    //....
    'components' => [
        'db' => [
            'class'         => 'edgardmessias\db\ibm\db2\Connection',
            'dsn'           => 'ibm:DRIVER={IBM DB2 ODBC DRIVER};DATABASE=test;HOSTNAME=127.0.0.1;PORT=50000;PROTOCOL=TCPIP',
            'username'      => 'username',
            'password'      => 'password',
            'defaultSchema' => '',
            'isISeries'     => false
        ],
    ],
];

Using ODBC IBM iAccess driver:

return [
    //....
    'components' => [
        'db' => [
            'class'         => 'edgardmessias\db\ibm\db2\Connection',
            'dsn'           => 'odbc:DRIVER={IBM i Access ODBC Driver 64-bit};SYSTEM=127.0.0.1;PROTOCOL=TCPIP',
            'username'      => 'username',
            'password'      => 'password',
            'defaultSchema' => '',
            'isISeries'     => false
        ],
    ],
];

If working on iSeries set isISeries parameter to true and fill defaultSchema.

Donations