@@ -43,7 +43,11 @@ Add the laravel-db2 Service Provider to your config in ``app/config/app.php``:
4343
4444### Configuration
4545
46- There are two ways to configure laravel-db2. You can choose the most convenient way for you. You can put your DB2 credentials into `` app/config/database.php `` (option 1) file or use package config file which you can be generated through command line by artisan (option 2).
46+ There are two ways to configure laravel-db2. You can choose the most convenient way for you. You can put your DB2 credentials into `` app/config/database.php `` (option 1) file or use package config file which you can generate through command line by artisan (option 2).
47+
48+ Please check appropriate specific DSN parameters for your connection.
49+ For instance here are the ODBC keywords for IBMi
50+ https://www.ibm.com/support/knowledgecenter/fr/ssw_ibm_i_73/rzaik/connectkeywords.htm
4751
4852#### Option 1: Configure DB2 using `` app/config/database.php `` file
4953
@@ -57,97 +61,103 @@ Simply add this code at the end of your ``app/config/database.php`` file:
5761 */
5862
5963 'ibmi' => [
60- 'driver' => 'odbc' / 'ibm' / 'odbczos',
61- 'driverName' => '{IBM i Access ODBC Driver}' / '{iSeries Access ODBC Driver}',
62- // General settings
63- 'host' => 'server',
64- 'username' => '',
65- 'password' => '',
66- //Server settings
67- 'database' => 'WRKRDBDIRE entry',
68- 'prefix' => '',
69- 'schema' => 'default schema',
70- 'port' => 50000,
71- 'signon' => 3,
72- 'ssl' => 0,
73- 'commitMode' => 2,
74- 'connectionType' => 0,
75- 'defaultLibraries' => '',
76- 'naming' => 0,
77- 'unicodeSql' => 0,
78- // Format settings
79- 'dateFormat' => 5,
80- 'dateSeperator' => 0,
81- 'decimal' => 0,
82- 'timeFormat' => 0,
83- 'timeSeparator' => 0,
84- // Performances settings
85- 'blockFetch' => 1,
86- 'blockSizeKB' => 32,
87- 'allowDataCompression' => 1,
88- 'concurrency' => 0,
89- 'lazyClose' => 0,
90- 'maxFieldLength' => 15360,
91- 'prefetch' => 0,
92- 'queryTimeout' => 1,
93- // Modules settings
94- 'defaultPkgLibrary' => 'QGPL',
95- 'defaultPackage' => 'A/DEFAULT(IBM),2,0,1,0',
96- 'extendedDynamic' => 1,
97- // Diagnostic settings
98- 'QAQQINILibrary' => '',
99- 'sqDiagCode' => '',
100- // Sort settings
101- 'languageId' => 'ENU',
102- 'sortTable' => '',
103- 'sortSequence' => 0,
104- 'sortWeight' => 0,
105- 'jobSort' => 0,
106- // Conversion settings
107- 'allowUnsupportedChar' => 0,
108- 'ccsid' => 1208,
109- 'graphic' => 0,
110- 'forceTranslation' => 0,
111- // Other settings
112- 'allowProcCalls' => 0,
113- 'DB2SqlStates' => 0,
114- 'debug' => 0,
115- 'trueAutoCommit' => 0,
116- 'catalogOptions' => 3,
117- 'libraryView' => 0,
118- 'ODBCRemarks' => 0,
119- 'searchPattern' => 1,
120- 'translationDLL' => '',
121- 'translationOption' => 0,
122- 'maxTraceSize' => 0,
123- 'multipleTraceFiles' => 1,
124- 'trace' => 0,
125- 'traceFilename' => '',
126- 'extendedColInfo' => 0,
127- 'options' => [
64+ 'driver' => 'db2_ibmi_odbc',
65+ // or 'db2_ibmi_ibm' / 'db2_zos_odbc' / 'db2_expressc_odbc
66+ 'driverName' => '{IBM i Access ODBC Driver}',
67+ // or '{iSeries Access ODBC Driver}' / '{IBM i Access ODBC Driver 64-bit}'
68+ 'host' => 'server',
69+ 'username' => '',
70+ 'password' => '',
71+ 'database' => 'WRKRDBDIRE entry',
72+ 'prefix' => '',
73+ 'schema' => 'default schema',
74+ 'port' => 50000,
75+ 'date_format' => 'Y-m-d H:i:s',
76+ // or 'Y-m-d H:i:s.u' / 'Y-m-d-H.i.s.u'...
77+ 'odbc_keywords' => [
78+ 'SIGNON' => 3,
79+ 'SSL' => 0,
80+ 'CommitMode' => 2,
81+ 'ConnectionType' => 0,
82+ 'DefaultLibraries' => '',
83+ 'Naming' => 0,
84+ 'UNICODESQL' => 0,
85+ 'DateFormat' => 5,
86+ 'DateSeperator' => 0,
87+ 'Decimal' => 0,
88+ 'TimeFormat' => 0,
89+ 'TimeSeparator' => 0,
90+ 'TimestampFormat' => 0,
91+ 'ConvertDateTimeToChar' => 0,
92+ 'BLOCKFETCH' => 1,
93+ 'BlockSizeKB' => 32,
94+ 'AllowDataCompression' => 1,
95+ 'CONCURRENCY' => 0,
96+ 'LAZYCLOSE' => 0,
97+ 'MaxFieldLength' => 15360,
98+ 'PREFETCH' => 0,
99+ 'QUERYTIMEOUT' => 1,
100+ 'DefaultPkgLibrary' => 'QGPL',
101+ 'DefaultPackage' => 'A /DEFAULT(IBM),2,0,1,0',
102+ 'ExtendedDynamic' => 0,
103+ 'QAQQINILibrary' => '',
104+ 'SQDIAGCODE' => '',
105+ 'LANGUAGEID' => 'ENU',
106+ 'SORTTABLE' => '',
107+ 'SortSequence' => 0,
108+ 'SORTWEIGHT' => 0,
109+ 'AllowUnsupportedChar' => 0,
110+ 'CCSID' => 819,
111+ 'GRAPHIC' => 0,
112+ 'ForceTranslation' => 0,
113+ 'ALLOWPROCCALLS' => 0,
114+ 'DB2SQLSTATES' => 0,
115+ 'DEBUG' => 0,
116+ 'TRUEAUTOCOMMIT' => 0,
117+ 'CATALOGOPTIONS' => 3,
118+ 'LibraryView' => 0,
119+ 'ODBCRemarks' => 0,
120+ 'SEARCHPATTERN' => 1,
121+ 'TranslationDLL' => '',
122+ 'TranslationOption' => 0,
123+ 'MAXTRACESIZE' => 0,
124+ 'MultipleTraceFiles' => 1,
125+ 'TRACE' => 0,
126+ 'TRACEFILENAME' => '',
127+ 'ExtendedColInfo' => 0,
128+ ],
129+ 'options' => [
128130 PDO::ATTR_CASE => PDO::CASE_LOWER,
129- PDO::ATTR_EMULATE_PREPARES => false,
130- PDO::ATTR_PERSISTENT => false
131+ PDO::ATTR_PERSISTENT => false,
132+ PDO::I5_ATTR_DBC_SYS_NAMING => false,
133+ PDO::I5_ATTR_COMMIT => PDO::I5_TXN_NO_COMMIT,
134+ PDO::I5_ATTR_JOB_SORT => false,
135+ PDO::I5_ATTR_DBC_LIBL => '',
136+ PDO::I5_ATTR_DBC_CURLIB => '',
131137 ]
132138 ],
133139
134- ```
135- driver setting is either 'odbc' for ODBC connection or 'ibm' for pdo_ibm connection
136- Then if driver is 'odbc', database must be set to ODBC connection name.
137- if driver is 'ibm', database must be set to IBMi database name (WRKRDBDIRE).
140+ ```
141+ driver setting can be:
142+ - 'db2_ibmi_odbc' for IBMi ODBC connection
143+ - 'db2_ibmi_ibm' for IBMi PDO_IBM connection
144+ - 'db2_zos_odbc' for zOS ODBC connection
145+ - 'db2_expressc_odbc for Express-C ODBC connection
146+
147+ Then if driver is 'db2_ * _ odbc', database must be set to ODBC connection name.
148+ if driver is 'db2_ibmi_ibm', database must be set to IBMi database name (WRKRDBDIRE).
138149
139150#### Option 2: Configure DB2 using package config file
140151
141152Run on the command line from the root of your project:
142153
143154```
144- $ php artisan config :publish cooperl/laravel-db2
155+ $ php artisan vendor :publish
145156```
146157
147- Set your laravel-db2 credentials in `` app/config/packages/cooperl/laravel- db2/config .php ``
158+ Set your laravel-db2 credentials in `` app/config/db2.php ``
148159the same way as above
149160
150-
151161## Usage
152162
153163Consult the [ Laravel framework documentation] ( http://laravel.com/docs ) .
0 commit comments