ibm_db 0.7.5 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES CHANGED
@@ -1,5 +1,10 @@
1
1
  Change Log
2
2
  ==============
3
+ 2007/07/05 (IBM_DB adapter 0.8.0, driver 0.7.0):
4
+ - Support for Informix Dynamic Server 11.10
5
+ - New driver method get_last_serial_value to retrieve last inserted serial
6
+ value for Informix Dynamic Server
7
+
3
8
  2007/06/19 (IBM_DB adapter 0.7.5, driver 0.6.0):
4
9
  - Driver code (ibm_db.c) remains at the same level: 0.6.0 (no changes)
5
10
  - Fixed client attributes initialization on connection setup [11264]
@@ -56,4 +61,4 @@ Change Log
56
61
  - Fixed compatibility issue with other adapters
57
62
  - If a schema is omitted in database.yml, the username is now used as default schema
58
63
  - Introduced descriptive CLI error messages when a connection or an execute statement fails
59
- - Introduced check against schema in method 'indexes'
64
+ - Introduced check against schema in method 'indexes'
data/README CHANGED
@@ -1,346 +1,367 @@
1
- =====================================================================
2
- README for the IBM_DB Adapter 0.7.5 and Driver 0.6.0 (2007/04/30)
3
- For ActiveRecord Version 1.15.3 (and Rails 1.2.3)
4
- =====================================================================
5
-
6
- Change Log
7
- ==============
8
- 2007/06/19 (IBM_DB adapter 0.7.5, driver 0.6.0):
9
- - Driver code (ibm_db.c) remains at the same level: 0.6.0 (no changes)
10
- - Fixed client attributes initialization on connection setup [11264]
11
- - Fixed rake db:schema:dump native data types limits incompatible with table create
12
-
13
- 2007/06/01 (IBM_DB adapter 0.7.0, driver 0.6.0):
14
- - Driver code (ibm_db.c) remains at the same level: 0.6.0 (no changes)
15
- - Fixed remaining failure on {:null => true} option for XML data type [#10877]
16
- - Fixed handling of {:id => false} option during table creation in DB2 for zOS
17
- - Fixed handle_lobs failures in table creation for has_many/belongs_to [#10701]
18
- - Fixe db2-i5-zOS.yaml content (removed inadvertent tab) [#11234]
19
-
20
- 2007/05/10 (IBM_DB adapter 0.6.5, driver 0.6.0):
21
- - Driver code (ibm_db.c) remains at the same level: 0.6.0 (no changes)
22
- - Fixed regression for reconnect after being inactive (connection recycle)
23
- - Fixed rake db:schema:load failures on boolean data type [#10683]
24
- - Fixed XML default option (:null => true for XML data type) [#10754]
25
- - Fixed DB2 for zOS version 9 handling of column changes for DEFAULT NULL
26
-
27
- 2007/04/30 (0.6.0):
28
- - Support for remote connections to DB2 Universal Database on z/OS version 9
29
- - Support for result set pagination via ActiveRecord add_limit_offset! method
30
- for DB2 Universal Database on z/OS and i5/OS
31
- - Defect fixes
32
- - Improved documentation
33
-
34
- 2007/04/20 (0.4.6):
35
- - Fixed XML columns creation default value (NOT NULL)
36
- - Fixed border case for IS NULL in where clauses
37
- - Improved documentation (connection attributes)
38
-
39
- 2007/04/20 (0.4.5):
40
- - Fixed reconnect problems: driver (IBM_DB::active) and adapter (active)
41
- - Client connection attribute rename (app_user to replace user)
42
- - Improved support for ROWID data type (DB2 for zOS version 8 and 9)
43
-
44
- 2007/03/21 (0.4.0):
45
- - Support added for remote connectivity to DB2 zOS version 8
46
- - Support added for remote connectivity to DB2 i5 v5r3 and v5r4
47
- - Improved migration support (added change_column method)
48
- - Support for setting and retrieving values for client attributes (user,
49
- account, application, workstation)
50
-
51
- 2006/10/31 (0.2.0):
52
- - Significant performance improvements
53
- - Improved stored procedure support at driver level
54
- - Added support for Large Object data types (LOBs) greater than 32K (BLOB, CLOB, XML) in size
55
- - Added XML data type support for native storage of XML documents
56
- - Significant quality improvements, through many bug fixes in the driver and adapter
57
- - Improved migration support (added add_column and remove_column methods)
58
-
59
- 2006/06/07 (0.1.0):
60
-
61
- - Fixed compatibility issue with other adapters
62
- - If a schema is omitted in database.yml, the username is now used as default schema
63
- - Introduced descriptive CLI error messages when a connection or an execute statement fails
64
- - Introduced check against schema in method 'indexes'
65
-
66
- Supported Operating Systems
67
- ============================
68
- - Linux 32/64 bit
69
- - Microsoft Windows 32 bit
70
- - IBM AIX 32/64 bit
71
- - HP-UX 32/64 bit
72
- - Sun Solaris 32/64 bit
73
-
74
-
75
- Supported Databases
76
- ====================
77
- - IBM DB2 Universal Database on Linux/Unix/Windows versions 8 and 9
78
- - Remote connections to IBM DB2 Universal Database on i5/OS versions V5R3 and V5R4.
79
- Please ensure PTF SI27358 (includes SI27250) is installed in i5/OS version 5R3 and
80
- and PTF SI27256 is installed while using i5/OS version 5R4.
81
- - Remote connections to IBM DB2 Universal Database on z/OS version 8 and 9
82
-
83
-
84
- There are two alternatives for installing the IBM_DB adapter and driver:
85
- A. Installing as a Ruby gem in the Ruby runtime
86
- B. Installing as a Rails plugin in a specific Rails application runtime
87
- Note: The IBM_DB driver can also be built separately (from source) and used in direct API calls.
88
-
89
- A. Installing the IBM_DB adapter and driver as a Ruby gem
90
- =======================================================
91
- The IBM_DB gem is an ActiveRecord adapter and requires the abstract adapter to register it
92
- in the list of RAILS_CONNECTION_ADAPTERS (active_record.rb) before it can be utilized in
93
- the Rails framework. Once registered, the IBM_DB adapter and its dependencies (ibm_db Ruby
94
- driver and the IBM Driver for ODBC and CLI) are loaded. This enables any application in the
95
- Ruby environment, including Rails, to interact with IBM data servers.
96
-
97
- 1. Windows platforms:
98
- =====================
99
- INSTALL (as Ruby gem)
100
- To remove previous gem version (optionally):
101
- D:\>gem uninstall ibm_db
102
- Successfully uninstalled ibm_db version 0.6.0
103
-
104
- Example:
105
- D:\>gem install ibm_db
106
- Bulk updating gem source index for: http://gems.rubyforge.org
107
- Select which gem to install for your platform (i386-mswin32)
108
- 1. ibm_db 0.6.5 (mswin32)
109
- 2. ibm_db 0.6.5 (ruby)
110
- 3. ibm_db 0.6.0 (mswin32)
111
- 4. ibm_db 0.6.0 (ruby)
112
-
113
- Running gem install ibm_db� you are presented with two choices for each release
114
- (mswin32 or ruby). Choose �mswin32� and the native extension (�ibm_db� driver)
115
- binary file for Windows is installed.
116
-
117
- TEST (simple gem install verification)
118
- Note: IBM_DB gem requires a manual step after install:
119
- add �ibm_db� into gems\1.8\gems\activerecord-1.15.3\lib\active_record.rb (Line 77)
120
- D:\NewApp>dir vendor\plugins
121
- D:\NewApp>irb
122
- irb(main):001:0> gem 'ibm_db'
123
- irb(main):002:0> require 'mswin32/ibm_db' // notice the [mswin32] in the library path
124
- irb(main):003:0> IBM_DB::connect 'sample', 'db2admin', 'secret'
125
- D:\NewApp>ruby script\console
126
-
127
- BUILD (optionally) �ibm_db� gem from sources (ibm_db-x.x.x.tar.gz):
128
- 1. Download source from Rubyforge
129
- http://rubyforge.org/frs/?group_id=2361
130
- 2. Build gem from specification (IBM_DB.gemspec)
131
- D:\IBM_DB_Adapter\ibm_db>gem build IBM_DB.gemspec
132
-
133
-
134
- 2. Linux and Unix platforms:
135
- ============================
136
-
137
- INSTALL (as Ruby gem)
138
- To remove previous gem version (optionally):
139
- $ gem uninstall ibm_db
140
- Successfully uninstalled ibm_db version 0.6.0
141
-
142
- Note: DB2 environment is required while using an arbitrary user account
143
- (other than the DB2 install user account)
144
- $ . /home/db2inst1/sqllib/db2profile
145
- $ export IBM_DB_DIR=/opt/ibm/db2/V9.1
146
- $ export IBM_DB_LIB=/opt/ibm/db2/V9.1/lib32
147
- $ gem install ibm_db
148
- Select which gem to install for your platform (i686-linux)
149
- 1. ibm_db 0.6.5 (mswin32)
150
- 2. ibm_db 0.6.5 (ruby)
151
- 3. ibm_db 0.6.0 (ruby)
152
- 4. ibm_db 0.6.0 (mswin32)
153
- ...
154
- Running gem install ibm_db� you are presented with two choices for each release
155
- (mswin32 or ruby). Choose �ruby� and the native extension (�ibm_db� driver) is built.
156
- ...
157
- > 2
158
- Building native extensions. This could take a while...
159
- Successfully installed ibm_db-0.6.5
160
- Installing ri documentation for ibm_db-0.6.5...
161
- Installing RDoc documentation for ibm_db-0.6.5...
162
-
163
- TEST (simple gem install verification)
164
- Note: IBM_DB gem requires a manual step after install:
165
- add �ibm_db� into /gems/activerecord-1.15.3/lib/active_record.rb (Line 77)
166
- $ ls -al vendor/plugins/
167
- $ irb
168
- irb(main):001:0> gem 'ibm_db'
169
- irb(main):002:0> require 'ibm_db' // notice the library path (different on win32)
170
- irb(main):003:0> IBM_DB::connect 'sample', 'db2admin', 'secret'
171
- $ ./script/console
172
-
173
- BUILD (optionally) �ibm_db� gem from sources (ibm_db-x.x.x.tar.gz):
174
- 1. Download source from Rubyforge
175
- http://rubyforge.org/frs/?group_id=2361
176
- 2. Build gem from specification (IBM_DB.gemspec)
177
- $ cd IBM_DB_Adapter/ibm_db
178
- $ gem build IBM_DB.gemspec
179
-
180
-
181
- B. Installing the IBM_DB adapter and driver as a Rails plugin
182
- =============================================================
183
- IBM_DB adapter and driver install as plugin provides support for IBM data servers
184
- within the scope of a specific and individual Rails application. Rails plugins do
185
- not offer the version management specific to Ruby gems, but does provide an
186
- initialization mechanism which allows the IBM_DB plugin to self-insert into the
187
- ActiveRecord's list of supported adapters: RAILS_CONNECTION_ADAPTERS. Therefore,
188
- after installing IBM_DB as plugin in your Rails application, no manual step is required
189
- for the Rails framework to load it.
190
-
191
- 1. Windows platforms
192
- =====================
193
- Register Repository and Query:
194
-
195
- A. Download and install Subversion (SVN) client from:
196
- http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=91
197
- Register rubyibm project as plugin source
198
- D:\NewApp>ruby script\plugin source svn://rubyforge.org/var/svn/rubyibm/trunk/IBM_DB_Adapter/
199
-
200
- B. Accessing RubyForge repository through HTTP (no SVN client required) is NOT YET ENABLED
201
- D:\NewApp>ruby script\plugin source http://rubyibm.rubyforge.org/IBM_DB_Adapter/
202
-
203
- LIST plugin
204
- D:\NewApp>ruby script\plugin list
205
-
206
- INSTALL (as Rails plugin)
207
- D:\NewApp>ruby script\plugin install ibm_db
208
-
209
- TEST (simple plugin install verification)
210
- Note: Make sure there's no ibm_db in gems\1.8\gems\activerecord-1.15.3\lib\active_record.rb (Line 77)
211
- D:\NewApp>ruby script\console
212
-
213
- 2. Linux and Unix platforms
214
- ===========================
215
- Register Repository and Query:
216
-
217
- A. Ensure Subversion (SVN) client is installed or download from:
218
- http://subversion.tigris.org/project_packages.html
219
- Register rubyibm project as plugin source
220
- $ ./script/plugin source svn://rubyforge.org/var/svn/rubyibm/trunk/IBM_DB_Adapter/
221
-
222
- B. Accessing RubyForge repository through HTTP (no SVN client required) is NOT YET ENABLED
223
- $ ./script/plugin source http://rubyibm.rubyforge.org/IBM_DB_Adapter/
224
-
225
- LIST plugin
226
- $ ./script/plugin list
227
-
228
- INSTALL (as Rails plugin)
229
- $ ./script/plugin install ibm_db
230
-
231
- TEST (simple plugin install verification)
232
- Note: Make sure there's no ibm_db in /gems/activerecord-1.15.3/lib/active_record.rb (Line 77)
233
- $ ./script/console
234
-
235
-
236
- Instructions for building and installing the IBM_DB driver from source
237
- =======================================================================
238
- Building the driver manually as described below is not required if any the install
239
- alternatives above have been pursued. This manual procedure is in fact automated
240
- on Linux and UNIX platforms by the IBM_DB gem and plugin install, but is presented
241
- here only for reference, and also involves running the unit tests.
242
-
243
- Prerequisites:
244
- Install Ruby from:
245
- http://rubyforge.org
246
-
247
- Linux and Unix platforms:
248
- Note: commands may vary depending on the shell used
249
- - To setup DB2 environment while using an arbitrary user account
250
- (other than the DB2 install user account):
251
- Example:
252
- $ . /home/db2inst1/sqllib/db2profile
253
-
254
- - To configure test database:
255
- DB2 v9.x: some IBM_DB driver tests require a UTF-8 database:
256
- $ db2 CREATE DATABASE testdrv USING CODESET UTF-8 \
257
- TERRITORY US COLLATE USING SYSTEM PAGESIZE 32768
258
- DB2 v8.x: driver tests 195 and 52949 requires XML functionality
259
- only available in DB2 v9.x
260
-
261
- - To configure database connection parameters edit config.yaml
262
- Example:
263
- database: testdrv
264
- user: db2inst1
265
- password: password
266
- hostname: localhost
267
- port: 50000
268
-
269
- - To compile and link with DB2 client libraries:
270
- $ export IBM_DB_DIR=/opt/ibm/db2/V9.1
271
- $ export IBM_DB_LIB=/opt/ibm/db2/V9.1/lib32
272
-
273
- Windows platforms:
274
- - Install Visual C++ 2003, Platform SDK (latest), .Net SDK Version 1.1 from:
275
- http://wiki.tcl.tk/11431
276
- - Set environment:
277
- CALL "C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\SetEnv.Cmd"
278
- CALL "C:\Program Files\Microsoft Visual C++ Toolkit 2003\vcvars32.bat"
279
- SET LIB=%LIB%;C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\lib
280
- - To configure database connection parameters edit config.yaml
281
-
282
- Build and Execution:
283
- rake
284
-
285
- Execution of tests without compilation (must have .so in ibm_db source directory):
286
- rake onlytests
287
-
288
- Execution of a single test inside the tests directory can be done by the following:
289
- export SINGLE_RUBY_TEST=test_001.rb
290
- rake
291
-
292
-
293
- Limitations and known problems
294
- ==============================
295
- - ActiveRecord rename_column method is not supported for DB2 LUW, zOS and i5
296
- - ActiveRecord remove_column method is not supported for DB2 zOS
297
- - The following tests from the ActiveRecord 1.15.3 test suite are expected to fail
298
- - test_limited_eager_with_multiple_order_columns
299
- - test_limited_eager_with_order
300
- - test_assign_ids_ignoring_blanks
301
- - test_build_by_new_record
302
- - test_get_ids
303
- - test_select_limited_ids_list
304
- - test_add_index
305
- - The following tests from the driver test suite are expected to fail on DB2 version 8
306
- on Linux/Unix/Windows because of missing native XML support. If you want to
307
- make use of the native XML features in DB2, please upgrade to version 9
308
- - test_195.rb
309
- - test_52949.rb
310
- - The driver returns an error when you try to insert a TIMESTAMP value into a DATE column.
311
- To fix this, please ensure that the following configuration keyword PATCH2=58 is set
312
- in the COMMON section of your DB2 CLI initialization file (db2cli.ini):
313
- - set: db2 UPDATE CLI CFG FOR SECTION COMMON USING PATCH2 58
314
- - verify: db2 GET CLI CFG FOR SECTION COMMON
315
- Please refer to http://publib.boulder.ibm.com/infocenter/db2luw/v9/topic/com.ibm.db2.udb.apdv.cli.doc/doc/c0007882.htm
316
- for more information.
317
- - The behaviour of ActiveRecord::Base.find(:first) without an :order attribute can be unpredictable.
318
- The first record (i.e. the record with the minimum id) may be not be retrieved. In a relational model,
319
- the order of the rows returned is unpredictable and independent of the order of insertion.
320
- This issue may be addressed in a future release.
321
- - Rails applications on DB2 9 require the APPLHEAPSZ database configuration parameter to be
322
- set to or above 1024. You will need to set this parameter for each database for which you will be
323
- running DB2 on Rails applications. Following is the command syntax for updating the
324
- applheapsz parameter:
325
- > db2 update db cfg for <database_name> using APPLHEAPSZ 1024
326
- To enable this parameter, you need to restart your DB2 instance.
327
- - IBM_DB is not supported on JRuby. As stated in the JRuby Wiki, "Basics of Getting JRuby Running":
328
- 'You may install other gems, but keep in mind that libraries with C extension dependencies
329
- will not work in JRuby.' http://www.headius.com/jrubywiki/index.php/Getting_Started
330
- The IBM_DB adapter relies on IBM_DB driver (C extension) and the IBM Driver for ODBC and
331
- CLI to access databases on IBM data servers. Alternatively, you can either use the regular C
332
- implementation of Ruby, or use ActiveRecord-JDBC adapter to access databases.
333
-
334
- To Do
335
- ====
336
- - Support Informix Dynamic Server 11.10
337
- - Support ActiveRecord remove_column method for DB2 zOS version 9
338
-
339
-
340
- Feedback
341
- ========
342
- Your feedback is very much appreciated and expected through Rubyforge:
343
- - rubyibm project: http://rubyforge.org/projects/rubyibm/
344
- - rubyibm forum: http://rubyforge.org/forum/?group_id=2361
345
- - rubyibm bug reports: http://rubyforge.org/tracker/?group_id=2361
346
- - IBM_DB developers: rubyibm-developers@rubyforge.org
1
+ =====================================================================
2
+ README for the IBM_DB Adapter 0.8.0 and Driver 0.7.0 (2007/07/11)
3
+ For ActiveRecord Version 1.15.3 (and Rails 1.2.3)
4
+ =====================================================================
5
+
6
+ Change Log
7
+ ==============
8
+ 2007/07/11 (IBM_DB adapter 0.8.0, driver 0.7.0):
9
+ - Support for Informix Dynamic Server 11.10 and beyond
10
+ - New driver method get_last_serial_value to retrieve last inserted serial
11
+ value for Informix Dynamic Server
12
+
13
+ 2007/06/19 (IBM_DB adapter 0.7.5, driver 0.6.0):
14
+ - Driver code (ibm_db.c) remains at the same level: 0.6.0 (no changes)
15
+ - Fixed client attributes initialization on connection setup [11264]
16
+ - Fixed rake db:schema:dump native data types limits incompatible with table create
17
+
18
+ 2007/06/01 (IBM_DB adapter 0.7.0, driver 0.6.0):
19
+ - Driver code (ibm_db.c) remains at the same level: 0.6.0 (no changes)
20
+ - Fixed remaining failure on {:null => true} option for XML data type [#10877]
21
+ - Fixed handling of {:id => false} option during table creation in DB2 for zOS
22
+ - Fixed handle_lobs failures in table creation for has_many/belongs_to [#10701]
23
+ - Fixe db2-i5-zOS.yaml content (removed inadvertent tab) [#11234]
24
+
25
+ 2007/05/10 (IBM_DB adapter 0.6.5, driver 0.6.0):
26
+ - Driver code (ibm_db.c) remains at the same level: 0.6.0 (no changes)
27
+ - Fixed regression for reconnect after being inactive (connection recycle)
28
+ - Fixed rake db:schema:load failures on boolean data type [#10683]
29
+ - Fixed XML default option (:null => true for XML data type) [#10754]
30
+ - Fixed DB2 for zOS version 9 handling of column changes for DEFAULT NULL
31
+
32
+ 2007/04/30 (0.6.0):
33
+ - Support for remote connections to DB2 Universal Database on z/OS version 9
34
+ - Support for result set pagination via ActiveRecord add_limit_offset! method
35
+ for DB2 Universal Database on z/OS and i5/OS
36
+ - Defect fixes
37
+ - Improved documentation
38
+
39
+ 2007/04/20 (0.4.6):
40
+ - Fixed XML columns creation default value (NOT NULL)
41
+ - Fixed border case for IS NULL in where clauses
42
+ - Improved documentation (connection attributes)
43
+
44
+ 2007/04/20 (0.4.5):
45
+ - Fixed reconnect problems: driver (IBM_DB::active) and adapter (active)
46
+ - Client connection attribute rename (app_user to replace user)
47
+ - Improved support for ROWID data type (DB2 for zOS version 8 and 9)
48
+
49
+ 2007/03/21 (0.4.0):
50
+ - Support added for remote connectivity to DB2 zOS version 8
51
+ - Support added for remote connectivity to DB2 i5 v5r3 and v5r4
52
+ - Improved migration support (added change_column method)
53
+ - Support for setting and retrieving values for client attributes (user,
54
+ account, application, workstation)
55
+
56
+ 2006/10/31 (0.2.0):
57
+ - Significant performance improvements
58
+ - Improved stored procedure support at driver level
59
+ - Added support for Large Object data types (LOBs) greater than 32K (BLOB, CLOB, XML) in size
60
+ - Added XML data type support for native storage of XML documents
61
+ - Significant quality improvements, through many bug fixes in the driver and adapter
62
+ - Improved migration support (added add_column and remove_column methods)
63
+
64
+ 2006/06/07 (0.1.0):
65
+
66
+ - Fixed compatibility issue with other adapters
67
+ - If a schema is omitted in database.yml, the username is now used as default schema
68
+ - Introduced descriptive CLI error messages when a connection or an execute statement fails
69
+ - Introduced check against schema in method 'indexes'
70
+
71
+ Supported Operating Systems
72
+ ============================
73
+ - Linux 32/64 bit
74
+ - Microsoft Windows 32 bit
75
+ - IBM AIX 32/64 bit
76
+ - HP-UX 32/64 bit
77
+ - Sun Solaris 32/64 bit
78
+
79
+
80
+ Supported Databases
81
+ ====================
82
+ - IBM DB2 Universal Database on Linux/Unix/Windows versions 8 and 9
83
+ - Remote connections to IBM DB2 Universal Database on i5/OS versions V5R3 and V5R4.
84
+ Please ensure PTF SI27358 (includes SI27250) is installed in i5/OS version 5R3 and
85
+ and PTF SI27256 is installed while using i5/OS version 5R4.
86
+ - Remote connections to IBM DB2 Universal Database on z/OS version 8 and 9
87
+ - Informix Dynamic Server 11.10 and beyond.
88
+ Please ensure that the IBM DataServer Viper 2 client is installed.
89
+
90
+
91
+ There are two alternatives for installing the IBM_DB adapter and driver:
92
+ A. Installing as a Ruby gem in the Ruby runtime
93
+ B. Installing as a Rails plugin in a specific Rails application runtime
94
+ Note: The IBM_DB driver can also be built separately (from source) and used in direct API calls.
95
+
96
+ A. Installing the IBM_DB adapter and driver as a Ruby gem
97
+ =======================================================
98
+ The IBM_DB gem is an ActiveRecord adapter and requires the abstract adapter to register it
99
+ in the list of RAILS_CONNECTION_ADAPTERS (active_record.rb) before it can be utilized in
100
+ the Rails framework. Once registered, the IBM_DB adapter and its dependencies (ibm_db Ruby
101
+ driver and the IBM Driver for ODBC and CLI) are loaded. This enables any application in the
102
+ Ruby environment, including Rails, to interact with IBM data servers.
103
+
104
+ 1. Windows platforms:
105
+ =====================
106
+ INSTALL (as Ruby gem)
107
+ To remove previous gem version (optionally):
108
+ D:\>gem uninstall ibm_db
109
+ Successfully uninstalled ibm_db version 0.6.0
110
+
111
+ Example:
112
+ D:\>gem install ibm_db
113
+ Bulk updating gem source index for: http://gems.rubyforge.org
114
+ Select which gem to install for your platform (i386-mswin32)
115
+ 1. ibm_db 0.6.5 (mswin32)
116
+ 2. ibm_db 0.6.5 (ruby)
117
+ 3. ibm_db 0.6.0 (mswin32)
118
+ 4. ibm_db 0.6.0 (ruby)
119
+
120
+ Running gem install ibm_db you are presented with two choices for each release
121
+ (mswin32 or ruby). Choose mswin32 and the native extension (ibm_db driver)
122
+ binary file for Windows is installed.
123
+
124
+ TEST (simple gem install verification)
125
+ Note: IBM_DB gem requires a manual step after install:
126
+ add ibm_db into gems\1.8\gems\activerecord-1.15.3\lib\active_record.rb (Line 77)
127
+ D:\NewApp>dir vendor\plugins
128
+ D:\NewApp>irb
129
+ irb(main):001:0> gem 'ibm_db'
130
+ irb(main):002:0> require 'mswin32/ibm_db' // notice the [mswin32] in the library path
131
+ irb(main):003:0> IBM_DB::connect 'sample', 'db2admin', 'secret'
132
+ D:\NewApp>ruby script\console
133
+
134
+ BUILD (optionally) ibm_db gem from sources (ibm_db-x.x.x.tar.gz):
135
+ 1. Download source from Rubyforge
136
+ http://rubyforge.org/frs/?group_id=2361
137
+ 2. Build gem from specification (IBM_DB.gemspec)
138
+ D:\IBM_DB_Adapter\ibm_db>gem build IBM_DB.gemspec
139
+
140
+
141
+ 2. Linux and Unix platforms:
142
+ ============================
143
+
144
+ INSTALL (as Ruby gem)
145
+ To remove previous gem version (optionally):
146
+ $ gem uninstall ibm_db
147
+ Successfully uninstalled ibm_db version 0.6.0
148
+
149
+ Note: DB2 environment is required while using an arbitrary user account
150
+ (other than the DB2 install user account)
151
+ $ . /home/db2inst1/sqllib/db2profile
152
+ $ export IBM_DB_DIR=/opt/ibm/db2/V9.1
153
+ $ export IBM_DB_LIB=/opt/ibm/db2/V9.1/lib32
154
+ $ gem install ibm_db
155
+ Select which gem to install for your platform (i686-linux)
156
+ 1. ibm_db 0.6.5 (mswin32)
157
+ 2. ibm_db 0.6.5 (ruby)
158
+ 3. ibm_db 0.6.0 (ruby)
159
+ 4. ibm_db 0.6.0 (mswin32)
160
+ ...
161
+ Running gem install ibm_db you are presented with two choices for each release
162
+ (mswin32 or ruby). Choose ruby and the native extension (ibm_db driver) is built.
163
+ ...
164
+ > 2
165
+ Building native extensions. This could take a while...
166
+ Successfully installed ibm_db-0.6.5
167
+ Installing ri documentation for ibm_db-0.6.5...
168
+ Installing RDoc documentation for ibm_db-0.6.5...
169
+
170
+ TEST (simple gem install verification)
171
+ Note: IBM_DB gem requires a manual step after install:
172
+ add ibm_db into /gems/activerecord-1.15.3/lib/active_record.rb (Line 77)
173
+ $ ls -al vendor/plugins/
174
+ $ irb
175
+ irb(main):001:0> gem 'ibm_db'
176
+ irb(main):002:0> require 'ibm_db' // notice the library path (different on win32)
177
+ irb(main):003:0> IBM_DB::connect 'sample', 'db2admin', 'secret'
178
+ $ ./script/console
179
+
180
+ BUILD (optionally) ibm_db gem from sources (ibm_db-x.x.x.tar.gz):
181
+ 1. Download source from Rubyforge
182
+ http://rubyforge.org/frs/?group_id=2361
183
+ 2. Build gem from specification (IBM_DB.gemspec)
184
+ $ cd IBM_DB_Adapter/ibm_db
185
+ $ gem build IBM_DB.gemspec
186
+
187
+
188
+ B. Installing the IBM_DB adapter and driver as a Rails plugin
189
+ =============================================================
190
+ IBM_DB adapter and driver install as plugin provides support for IBM data servers
191
+ within the scope of a specific and individual Rails application. Rails plugins do
192
+ not offer the version management specific to Ruby gems, but does provide an
193
+ initialization mechanism which allows the IBM_DB plugin to self-insert into the
194
+ ActiveRecord's list of supported adapters: RAILS_CONNECTION_ADAPTERS. Therefore,
195
+ after installing IBM_DB as plugin in your Rails application, no manual step is required
196
+ for the Rails framework to load it.
197
+
198
+ 1. Windows platforms
199
+ =====================
200
+ Register Repository and Query:
201
+
202
+ A. Download and install Subversion (SVN) client from:
203
+ http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=91
204
+ Register rubyibm project as plugin source
205
+ D:\NewApp>ruby script\plugin source svn://rubyforge.org/var/svn/rubyibm/trunk/IBM_DB_Adapter/
206
+
207
+ B. Accessing RubyForge repository through HTTP (no SVN client required) is NOT YET ENABLED
208
+ D:\NewApp>ruby script\plugin source http://rubyibm.rubyforge.org/IBM_DB_Adapter/
209
+
210
+ LIST plugin
211
+ D:\NewApp>ruby script\plugin list
212
+
213
+ INSTALL (as Rails plugin)
214
+ D:\NewApp>ruby script\plugin install ibm_db
215
+
216
+ TEST (simple plugin install verification)
217
+ Note: Make sure there's no ibm_db in gems\1.8\gems\activerecord-1.15.3\lib\active_record.rb (Line 77)
218
+ D:\NewApp>ruby script\console
219
+
220
+ 2. Linux and Unix platforms
221
+ ===========================
222
+ Register Repository and Query:
223
+
224
+ A. Ensure Subversion (SVN) client is installed or download from:
225
+ http://subversion.tigris.org/project_packages.html
226
+ Register rubyibm project as plugin source
227
+ $ ./script/plugin source svn://rubyforge.org/var/svn/rubyibm/trunk/IBM_DB_Adapter/
228
+
229
+ B. Accessing RubyForge repository through HTTP (no SVN client required) is NOT YET ENABLED
230
+ $ ./script/plugin source http://rubyibm.rubyforge.org/IBM_DB_Adapter/
231
+
232
+ LIST plugin
233
+ $ ./script/plugin list
234
+
235
+ INSTALL (as Rails plugin)
236
+ $ ./script/plugin install ibm_db
237
+
238
+ TEST (simple plugin install verification)
239
+ Note: Make sure there's no ibm_db in /gems/activerecord-1.15.3/lib/active_record.rb (Line 77)
240
+ $ ./script/console
241
+
242
+
243
+ Instructions for building and installing the IBM_DB driver from source
244
+ =======================================================================
245
+ Building the driver manually as described below is not required if any the install
246
+ alternatives above have been pursued. This manual procedure is in fact automated
247
+ on Linux and UNIX platforms by the IBM_DB gem and plugin install, but is presented
248
+ here only for reference, and also involves running the unit tests.
249
+
250
+ Prerequisites:
251
+ Install Ruby from:
252
+ http://rubyforge.org
253
+
254
+ Linux and Unix platforms:
255
+ Note: commands may vary depending on the shell used
256
+ - To setup DB2 environment while using an arbitrary user account
257
+ (other than the DB2 install user account):
258
+ Example:
259
+ $ . /home/db2inst1/sqllib/db2profile
260
+
261
+ - To configure test database:
262
+ DB2 v9.x: some IBM_DB driver tests require a UTF-8 database:
263
+ $ db2 CREATE DATABASE testdrv USING CODESET UTF-8 \
264
+ TERRITORY US COLLATE USING SYSTEM PAGESIZE 32768
265
+ DB2 v8.x: driver tests 195 and 52949 requires XML functionality
266
+ only available in DB2 v9.x
267
+
268
+ - To configure database connection parameters edit config.yaml
269
+ Example:
270
+ database: testdrv
271
+ user: db2inst1
272
+ password: password
273
+ hostname: localhost
274
+ port: 50000
275
+
276
+ - To compile and link with DB2 client libraries:
277
+ $ export IBM_DB_DIR=/opt/ibm/db2/V9.1
278
+ $ export IBM_DB_LIB=/opt/ibm/db2/V9.1/lib32
279
+
280
+ Windows platforms:
281
+ - Install Visual C++ 2003, Platform SDK (latest), .Net SDK Version 1.1 from:
282
+ http://wiki.tcl.tk/11431
283
+ - Set environment:
284
+ CALL "C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\SetEnv.Cmd"
285
+ CALL "C:\Program Files\Microsoft Visual C++ Toolkit 2003\vcvars32.bat"
286
+ SET LIB=%LIB%;C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\lib
287
+ - To configure database connection parameters edit config.yaml
288
+
289
+ Build and Execution:
290
+ rake
291
+
292
+ Execution of tests without compilation (must have .so in ibm_db source directory):
293
+ rake onlytests
294
+
295
+ Execution of a single test inside the tests directory can be done by the following:
296
+ export SINGLE_RUBY_TEST=test_001.rb
297
+ rake
298
+
299
+
300
+ Limitations and known problems
301
+ ==============================
302
+ - ActiveRecord rename_column method is not supported for DB2 LUW, zOS and i5
303
+ - ActiveRecord remove_column method is not supported for DB2 zOS
304
+ - The following tests from the ActiveRecord 1.15.3 test suite are expected to fail
305
+ - test_limited_eager_with_multiple_order_columns
306
+ - test_limited_eager_with_order
307
+ - test_assign_ids_ignoring_blanks
308
+ - test_build_by_new_record
309
+ - test_get_ids
310
+ - test_select_limited_ids_list
311
+ - test_add_index
312
+ - The following tests from the driver test suite are expected to fail on DB2 version 8
313
+ on Linux/Unix/Windows and Informix Dynamic Server because of missing native XML support. If you want to
314
+ make use of the native XML features in DB2, please upgrade to version 9 or later
315
+ - test_195.rb
316
+ - test_52949.rb
317
+ - The driver returns an error when you try to insert a TIMESTAMP value into a DATE column.
318
+ To fix this, please ensure that the following configuration keyword PATCH2=58 is set
319
+ in the COMMON section of your DB2 CLI initialization file (db2cli.ini):
320
+ - set: db2 UPDATE CLI CFG FOR SECTION COMMON USING PATCH2 58
321
+ - verify: db2 GET CLI CFG FOR SECTION COMMON
322
+ Please refer to http://publib.boulder.ibm.com/infocenter/db2luw/v9/topic/com.ibm.db2.udb.apdv.cli.doc/doc/c0007882.htm
323
+ for more information.
324
+ - The behaviour of ActiveRecord::Base.find(:first) without an :order attribute can be unpredictable.
325
+ The first record (i.e. the record with the minimum id) may be not be retrieved. In a relational model,
326
+ the order of the rows returned is unpredictable and independent of the order of insertion.
327
+ This issue may be addressed in a future release.
328
+ - Rails applications on DB2 9 require the APPLHEAPSZ database configuration parameter to be
329
+ set to or above 1024. You will need to set this parameter for each database for which you will be
330
+ running DB2 on Rails applications. Following is the command syntax for updating the
331
+ applheapsz parameter:
332
+ > db2 update db cfg for <database_name> using APPLHEAPSZ 1024
333
+ To enable this parameter, you need to restart your DB2 instance.
334
+ - If you see connectivity issues with Informix Dynamic Server, please ensure that the server is configured to accept DRDA connections.
335
+ Please refer to http://publib.boulder.ibm.com/infocenter/idshelp/v111/index.jsp?topic=/com.ibm.admin.doc/admin154.htm for more information.
336
+ - The following tests from the ActiveRecord 1.15.3 test suite are expected to fail on Informix Dynamic Server
337
+ - test_quote
338
+ - test_to_xml
339
+ - test_should_calculate_grouped_by_function
340
+ - test_should_calculate_grouped_by_function_with_table_alias
341
+ - test_inserts_with_pre_and_suffix
342
+ - test_add_table_with_decimals
343
+ - test_no_limits_datatypes_IBM_DB
344
+ - test_instance_update_should_quote_pkey
345
+ - test_integer_columns
346
+ - test_arguments_line_up
347
+ - test_no_dump_errors
348
+ - test_schema_dump_includes_decimal_options
349
+ - IBM_DB is not supported on JRuby. As stated in the JRuby Wiki, "Basics of Getting JRuby Running":
350
+ 'You may install other gems, but keep in mind that libraries with C extension dependencies
351
+ will not work in JRuby.' http://www.headius.com/jrubywiki/index.php/Getting_Started
352
+ The IBM_DB adapter relies on IBM_DB driver (C extension) and the IBM Driver for ODBC and
353
+ CLI to access databases on IBM data servers. Alternatively, you can either use the regular C
354
+ implementation of Ruby, or use ActiveRecord-JDBC adapter to access databases.
355
+
356
+ To Do
357
+ ====
358
+ - Support ActiveRecord remove_column method for DB2 zOS version 9
359
+
360
+
361
+ Feedback
362
+ ========
363
+ Your feedback is very much appreciated and expected through Rubyforge:
364
+ - rubyibm project: http://rubyforge.org/projects/rubyibm/
365
+ - rubyibm forum: http://rubyforge.org/forum/?group_id=2361
366
+ - rubyibm bug reports: http://rubyforge.org/tracker/?group_id=2361
367
+ - IBM_DB developers: rubyibm-developers@rubyforge.org