ibm_db 2.5.14-x86-linux

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGES +210 -0
  3. data/LICENSE +18 -0
  4. data/MANIFEST +14 -0
  5. data/ParameterizedQueries README +39 -0
  6. data/README +225 -0
  7. data/ext/Makefile.nt32 +181 -0
  8. data/ext/Makefile.nt32.191 +212 -0
  9. data/ext/extconf.rb +127 -0
  10. data/ext/ibm_db.c +11719 -0
  11. data/ext/ruby_ibm_db.h +240 -0
  12. data/ext/ruby_ibm_db_cli.c +845 -0
  13. data/ext/ruby_ibm_db_cli.h +489 -0
  14. data/init.rb +42 -0
  15. data/lib/IBM_DB.rb +2 -0
  16. data/lib/active_record/connection_adapters/ibm_db_adapter.rb +3020 -0
  17. data/lib/active_record/connection_adapters/ibm_db_pstmt.rb +1965 -0
  18. data/lib/active_record/connection_adapters/ibmdb_adapter.rb +2 -0
  19. data/lib/active_record/vendor/db2-i5-zOS.yaml +328 -0
  20. data/lib/ibm_db.rb +8 -0
  21. data/lib/linux/rb18x/ibm_db.so +0 -0
  22. data/lib/linux/rb19x/ibm_db.so +0 -0
  23. data/lib/linux/rb2x/ibm_db.so +0 -0
  24. data/test/cases/adapter_test.rb +207 -0
  25. data/test/cases/associations/belongs_to_associations_test.rb +711 -0
  26. data/test/cases/associations/cascaded_eager_loading_test.rb +181 -0
  27. data/test/cases/associations/has_and_belongs_to_many_associations_test.rb +851 -0
  28. data/test/cases/associations/join_model_test.rb +743 -0
  29. data/test/cases/attribute_methods_test.rb +822 -0
  30. data/test/cases/base_test.rb +2133 -0
  31. data/test/cases/calculations_test.rb +482 -0
  32. data/test/cases/migration_test.rb +2408 -0
  33. data/test/cases/persistence_test.rb +642 -0
  34. data/test/cases/query_cache_test.rb +257 -0
  35. data/test/cases/relations_test.rb +1182 -0
  36. data/test/cases/schema_dumper_test.rb +256 -0
  37. data/test/cases/transaction_callbacks_test.rb +300 -0
  38. data/test/cases/validations/uniqueness_validation_test.rb +299 -0
  39. data/test/cases/xml_serialization_test.rb +408 -0
  40. data/test/config.yml +154 -0
  41. data/test/connections/native_ibm_db/connection.rb +44 -0
  42. data/test/ibm_db_test.rb +25 -0
  43. data/test/models/warehouse_thing.rb +5 -0
  44. data/test/schema/i5/ibm_db_specific_schema.rb +137 -0
  45. data/test/schema/ids/ibm_db_specific_schema.rb +140 -0
  46. data/test/schema/luw/ibm_db_specific_schema.rb +137 -0
  47. data/test/schema/schema.rb +751 -0
  48. data/test/schema/zOS/ibm_db_specific_schema.rb +208 -0
  49. metadata +109 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 48a57f3bf6ea7a434de3863887c5a01ba735f9a4
4
+ data.tar.gz: 572a72e2c279dc4c3f7d3b360907a5073a26914f
5
+ SHA512:
6
+ metadata.gz: 8c17ea137f8873f91914c165437db634ae3c19f5408824a5e79a0da68ec3c91ddbd2136df76478e73bbac14bbc6b4ea9928d1df2a90f8a05232e02a076c08d8b
7
+ data.tar.gz: d8be7a36d4a309350fd99252cb599d08ae1824bc1f313170f7dbcf83fec8af5f2cfbff970edaa20ec524c72e5f7a6e10358e5b23dbac7674714d554a48551615
data/CHANGES ADDED
@@ -0,0 +1,210 @@
1
+ Change Log
2
+ ==============
3
+ 2014/02/11 (IBM_DB adapter 2.5.14, driver 2.5.14) :
4
+ - Support for Rails 4
5
+ - Support for ruby-2.0
6
+
7
+ 2014/01/28 (IBM_DB adapter 2.5.12, driver 2.5.11) :
8
+ - Supporting usage of name ibmdb as adapter along with current name ibm_db to support requirements of cloud environments
9
+
10
+ 2012/12/07 (IBM_DB adapter 2.5.11, driver 2.5.11) :
11
+ - Fixed bug #29633 - Deletes cause too many handles to be consumed and not freed
12
+ - Support for Mac OS CLI library loading to check create and drop db functionality - #29625
13
+ - Fixed #29657 - @servertype of IBM_DBAdapter could end up being nil on DB2 for Z/OS version 9
14
+
15
+ 2012/05/01 (IBM_DB adapter 2.5.10, driver 2.5.10) :
16
+ - Support for Rails-3.2
17
+ - Changes in installation process. Now user should set only one environment variable IBM_DB_HOME to DB2/IBM_Data_Server_Driver installation directory
18
+ - Fixed bug #29541 - Serialize data when corresponding field maps to CLOB type on Database
19
+ - Fixed bug #29561 - Fixed data truncation error when client and server codepages are different
20
+ - Updated IBM_DB specifics of AR test suite as per Rails-3.2.3
21
+
22
+ 2012/01/03 (IBM_DB adapter 2.5.9, driver 2.5.9) :
23
+ - Support for Create and Drop database on DB2 LUW with DB2 client version V97fp4 and above
24
+ - Fixed bug #29482 - Fixed bigint being returned as string in the adapter
25
+
26
+ 2011/09/18 (IBM_DB adapter 2.5.7, driver 2.5.7) :
27
+ - Support for Rails-3.1.0
28
+ - Fixed bug #29052 -> prepare results in empty error message
29
+ - Support for continuation of method IBM_DB.conn_error and IBM_DB.conn_errormsg - #29324
30
+ - Test suite update as for Rails-3.1.0
31
+
32
+ 2011/02/07 (IBM_DB adapter 2.5.6, driver 2.5.6) :
33
+ - Fixed Bug #28622, #28881
34
+ - Decimal datatypes will now be returned as BigDecimal type from the driver
35
+ - Changes to rollback any active transaction in the connection destructor method if connection is not explicitly closed
36
+ - Changes to have a single gem file for ruby 1.8 and ruby 1.9
37
+ 2010/07/15 (IBM_DB adapter 2.5.5, driver 2.5.5) :
38
+ - Support for datatype Graphic and Vargraphic in driver and adapter [27965]
39
+ - Support for Bigint datatype in adapter.
40
+ - Fixed bug [28295] --> IBM_DB, Unicode Version, fails with encoding error against Informix Server
41
+
42
+ 2010/05/12 (IBM_DB adapter 2.5.0, driver 2.5.0) :
43
+ - Support for Unicode with Ruby 1.9 [Data from the IBM_DB driver is returned in UTF8 format]
44
+ - Fixed bug [27954] --> Fixed Truncation of char for bit data containing a Null Terminator
45
+ - Removed handling of NilClass type data in quote method. Super class will handle appropriately.
46
+
47
+ 2010/01/21 (IBM_DB adapter 2.0.0, driver 2.0.0) :
48
+ - Support for usage of parameterized SQL queries
49
+ - Exposed constant VERSION in the driver [Feature Request: #27231]
50
+
51
+ 2009/08/21 (IBM_DB adapter 1.5.0, driver 1.5.0) :
52
+ - non-block enhancement in the ruby driver made for Ruby version 1.9. [support request #25023]
53
+ - New API's getErrormsg and getErrorstate for retrieving error messages/state added
54
+ - Re-defined raising of exception from driver. [Bug #26544]
55
+ - Made adapter changes as per the new API's exposed in the driver for retrieving error messages
56
+ - API's conn_errormsg and stmt_errormsg is been deprecated.
57
+
58
+ 2009/07/28 (IBM_DB adapter 1.1.1, driver 1.1.0) :
59
+ - Fixed bug [26705] --> Fixed the problem of primary key value starting with 100
60
+ - Support for Activerecord-2.3.3
61
+ - Added method primary_key, which returns the primary key column name of the specified table
62
+ - Test suite updated
63
+
64
+ 2009/06/17 (IBM_DB adapter 1.1.0, driver 1.1.0) :
65
+ - Support for Activerecord's Query Cache Mechanism
66
+ - rename_column support for DB2 on LUW version 9.7, DB2 on zOS 9 and enhanced rename_column support for Informix Dynamic Server
67
+ - Support for parameterized timestamp datatype feature of DB2 on LUW Version 9.7
68
+ - Enhanced support for Bigint datatype along with support for Bigserial datatype (with client version 9.7 and above) of IDS
69
+ - Callback method handle_lobs enhanced by making it to use prepared statements completely
70
+ - Handling of exceptions during fetch operations enabled
71
+
72
+ 2009/03/24 (IBM_DB adapter 1.0.5, driver 1.0.5) :
73
+ - Support for Ruby-1.9.1
74
+ - Support for SQLRowcount in driver
75
+ - Support for Activerecord-2.3.2 [test suite updated]
76
+ - Fixed bug [24663] --> Fixed pre-mature clearing of the sql array in handle_lobs
77
+ - Fixed bug [23115] --> Fixed truncation of a nested query during update
78
+ - Fixed wrong setting of SQLID for schema on zOS 8 dataserver when schema is explicitly specified.
79
+
80
+ 2009/03/06 (IBM_DB adapter 1.0.2, driver 1.0.1) :
81
+ - Support for specifying connection timeout in adapter
82
+ - Fixed Bug [23317] --> Fixed assumption of id as the primary key while updation/insertion of lob fields
83
+ - Fixed Bug [23389] --> Provided proper exception handling.
84
+ - Fixed the insertion of incorrect value for lob objects in case of has_and_belongs_to_many associations.
85
+
86
+ 2008/12/18 (IBM_DB adapter 1.0.1, driver 1.0.1) :
87
+ - Support for datatype decfloat
88
+ - Changes in installation process. Now user should set IBM_DB_INCLUDE env variable instead of IBM_DB_DIR
89
+ - Support for specifying the Authentication type to be used during connection in adapter
90
+ - Corrected the ignorance of a connection, when the connection is successful with a warning
91
+ - ActiveRecord-2.2.2 test suite changes for IBM_DB
92
+ 2008/11/06 (IBM_DB adapter 1.0.0, driver 0.10.0):
93
+ - Support for short-hand migration syntax for datatype char and double in create_table
94
+ - Support for short-hand migration syntax for datatypes xml, char and double in change_table
95
+ - Support for secure connections using SSL (SECURITY=SSL) feature of DB2 in Adapter
96
+ Note: - This is supported from client version V9.5fp2 and onwards
97
+ - Support for altering the nullability constraint of a column.
98
+ - Added correct mapping for datatype :double for DB2 and Informix (double precision)
99
+ - Method support_ddl_transactions? overridden to return true. Feature of Rails2.2
100
+ IBM Dataservers support transactional migrations.
101
+ - Change in the style of accessing driver methods
102
+ Changed from scope resolution operator to dot operator
103
+ IBM_DB::connect '<db_name>','<username>','<pwd>' to IBM_DB.connect '<db_name>','<username>','<pwd>'
104
+ - Fixed Bug [#22430] --> Fixed limit ignorance for type character [char]
105
+ - ActiveRecord-2.1.2 test suite changes for IBM_DB
106
+
107
+ 2008/09/01 (IBM_DB adapter 0.10.0, driver 0.10.0):
108
+ - Added Trusted Context support in Driver
109
+ - Made changes for the correct Mapping of Informix DataTypes to Ruby DataTypes
110
+ - ActiveRecord-2.1.0 test suite changes appropriate for DB2/IDS is been updated
111
+
112
+ 2008/06/24 (IBM_DB adapter 0.9.5, driver 0.9.5):
113
+ - Fixed Bug [#19222] --> Fixed fixture insertion of LOB columns for DB2
114
+ - Fixed Bug [#19970] --> Fixed Table schema dumper also dump views
115
+ - Fixed Bug [#20053] --> Fixed CLOB data with special chars contains null characters upon retrieval
116
+ - Fixed Bug [#20762] --> IBM_DB adapter with Rails 2.1 fails on rake db:migrate
117
+ - Cleaned up fix for Bug [#19223] and [#19224], indexes are now dumped as array without schema qualified name.
118
+ - Support for Rails-2.0.2
119
+ - Support for Rails-2.1.0
120
+ Rails-2.1.0 contains changes that generates Non-standard SQL in 2 noticed cases which won't work with SQL compliant databases like DB2
121
+ a. Handling Nullable columns in Table creation. [http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/398-non-standard-sql-generated-in-column-definition-for-nullable-columns-in-create-table-ddl-rails-2-1#ticket-398-2]
122
+ A workaround for this problem is provided from within ibm_db adapter.
123
+ b. Handling has_and_belongs_to_many association. [http://rails.lighthouseapp.com/projects/8994/tickets/394-patch-fixed-non-standard-sql-generated-by-preloading-has_and_belongs_to_many-associations].
124
+ It is not possible to provide a workaround for this from within the ibm_db adapter.
125
+ To workaround this problem please patch ActiveRecord-2.1.0 with the patch available at [http://rails.lighthouseapp.com/attachments/26975/association_preloading.diff]
126
+
127
+ 2008/04/28 (IBM_DB adapter 0.9.4, driver 0.9.4):
128
+ - Fixed bug [#19679]--> invalid values being returned for blank or null in fetch_assoc
129
+ - Fixed bug [#19223] and [#19224]--> handling of composite and unique indexes incorrect
130
+ - Support for the Rails2.0 type of migrations for columns of type xml [t.xml :xml_col1,:xml_col2]
131
+
132
+ 2008/03/10 (IBM_DB adapter 0.9.3, driver 0.9.3):
133
+ - Resolved the issue of truncation of output when stored procedure was called
134
+
135
+ 2007/11/30 (IBM_DB adapter 0.9.2, driver 0.9.1):
136
+ - Lifted index length limitation (18 chars) and fixed multiple index creation
137
+ - Fixed [#13294] limit/offset breaks subselect in db2 adapter
138
+ - Fixed error handling for metadata retrieval (tables, columns, indexes)
139
+
140
+ 2007/11/07 (IBM_DB adapter 0.9.1, driver 0.9.1):
141
+ - Fixed ibm_db driver VC80 runtime issue on Windows
142
+
143
+ 2007/09/28 (IBM_DB adapter 0.9.0, driver 0.9.0):
144
+ - Fixed ibm_db gem 0.8.5 incompatibility with DB2 CLI 9.1 FP3 and below
145
+
146
+ 2007/09/13 (IBM_DB adapter 0.8.5, driver 0.8.5):
147
+ - Fixed Ruby driver crash on Windows Vista [#13357]
148
+
149
+ 2007/07/05 (IBM_DB adapter 0.8.0, driver 0.7.0):
150
+ - Support for Informix Dynamic Server 11.10
151
+ - New driver method get_last_serial_value to retrieve last inserted serial
152
+ value for Informix Dynamic Server
153
+
154
+ 2007/06/19 (IBM_DB adapter 0.7.5, driver 0.6.0):
155
+ - Driver code (ibm_db.c) remains at the same level: 0.6.0 (no changes)
156
+ - Fixed client attributes initialization on connection setup [11264]
157
+ - Fixed rake db:schema:dump native data types limits incompatible with table create
158
+
159
+ 2007/06/01 (IBM_DB adapter 0.7.0, driver 0.6.0):
160
+ - Driver code (ibm_db.c) remains at the same level: 0.6.0 (no changes)
161
+ - Fixed remaining failure on {:null => true} option for XML data type [#10877]
162
+ - Fixed handling of {:id => false} option during table creation in DB2 for zOS
163
+ - Fixed handle_lobs failures in table creation for has_many/belongs_to [#10701]
164
+ - Fixe db2-i5-zOS.yaml content (removed inadvertent tab) [#11234]
165
+
166
+ 2007/05/10 (IBM_DB adapter 0.6.5, driver 0.6.0):
167
+ - Driver code (ibm_db.c) remains at the same level: 0.6.0 (no changes)
168
+ - Fixed regression for reconnect after being inactive (connection recycle)
169
+ - Fixed rake db:schema:load failures on boolean data type [#10683]
170
+ - Fixed XML default option (:null => true for XML data type) [#10754]
171
+ - Fixed DB2 for zOS version 9 handling of column changes for DEFAULT NULL
172
+
173
+ 2007/04/30 (0.6.0):
174
+ - Support for remote connections to DB2 Universal Database on z/OS version 9
175
+ - Support for result set pagination via ActiveRecord add_limit_offset! method
176
+ for DB2 Universal Database on z/OS and i5/OS
177
+ - Defect fixes
178
+ - Improved documentation
179
+
180
+ 2007/04/20 (0.4.6):
181
+ - Fixed XML columns creation default value (NOT NULL)
182
+ - Fixed border case for IS NULL in where clauses
183
+ - Improved documentation (connection attributes)
184
+
185
+ 2007/04/20 (0.4.5):
186
+ - Fixed reconnect problems: driver (IBM_DB::active) and adapter (active)
187
+ - Client connection attribute rename (app_user to replace user)
188
+ - Improved support for ROWID data type (DB2 for zOS version 8 and 9)
189
+
190
+ 2007/03/21 (0.4.0):
191
+ - Support added for remote connectivity to DB2 zOS version 8
192
+ - Support added for remote connectivity to DB2 i5 v5r3 and v5r4
193
+ - Improved migration support (added change_column method)
194
+ - Support for setting and retrieving values for client attributes (user,
195
+ account, application, workstation)
196
+
197
+ 2006/10/31 (0.2.0):
198
+ - Significant performance improvements
199
+ - Improved stored procedure support at driver level
200
+ - Added support for Large Object data types (LOBs) greater than 32K (BLOB, CLOB, XML) in size
201
+ - Added XML data type support for native storage of XML documents
202
+ - Significant quality improvements, through many bug fixes in the driver and adapter
203
+ - Improved migration support (added add_column and remove_column methods)
204
+
205
+ 2006/06/07 (0.1.0):
206
+
207
+ - Fixed compatibility issue with other adapters
208
+ - If a schema is omitted in database.yml, the username is now used as default schema
209
+ - Introduced descriptive CLI error messages when a connection or an execute statement fails
210
+ - Introduced check against schema in method 'indexes'
data/LICENSE ADDED
@@ -0,0 +1,18 @@
1
+ Copyright (c) 2006, 2007, 2008, 2009, 2010 IBM Corporation
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the "Software"),
5
+ to deal in the Software without restriction, including without limitation
6
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
7
+ and/or sell copies of the Software, and to permit persons to whom the Software
8
+ is furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included
11
+ in all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
14
+ INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
15
+ PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
16
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
17
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
18
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/MANIFEST ADDED
@@ -0,0 +1,14 @@
1
+ CHANGES
2
+ README
3
+ LICENSE
4
+ ext/extconf.rb
5
+ ext/ibm_db.c
6
+ ext/ruby_ibm_db.h
7
+ lib/IBM_DB.rb
8
+ lib/linux32/ibm_db.so
9
+ lib/mswin32/ibm_db.so
10
+ lib/active_record/connection_adapters/ibm_db_adapter.rb
11
+ lib/active_record/vendor/db2-i5-zOS.yaml
12
+ test/activerecord/native_ibm_db/connection.rb
13
+ test/ibm_db_test.rb
14
+ MANIFEST
@@ -0,0 +1,39 @@
1
+ +-------------------------------------------+-------------------------------------------+
2
+ | README for Parameterized Queries Support in Ruby-on-Rails/ Activerecord applications |
3
+ +-------------------------------------------+-------------------------------------------+
4
+
5
+ Enabling Usage of Parameterized Queries with Ruby-on-Rails / Activerecord applications
6
+ ======================================================================================
7
+ To enable usage of parameterized SQL queries with Ruby-on-Rails/ActiveRecord applications, in your connection configuration (database.yml), set "parameterized" to true. By default "parameterized" is false (if not specified). A sample database.yml file showing development section with parameterized queries enabled looks as below
8
+
9
+ development:
10
+ adapter: ibm_db
11
+ username: db2inst1
12
+ password: secret
13
+ database: devdb
14
+ #schema: db2inst1
15
+ #host: localhost
16
+ #port: 50000
17
+ #account: my_account
18
+ #app_user: my_app_user
19
+ #application: my_application
20
+ #workstation: my_workstation
21
+ parameterized: true
22
+
23
+ Similarly for the other sections (test/production) of the database.yml file set "parameterized" to true to enable usage of parameterized SQL queries
24
+
25
+ Supported Activerecord Versions
26
+ ===============================
27
+ Activerecord-2.3.3, Activerecord-2.3.4, Activerecord-2.3.5
28
+
29
+ Supported Operating Systems and Databases
30
+ =========================================
31
+ Refer the main README
32
+
33
+ Feedback
34
+ ========
35
+ Your feedback is very much appreciated and expected through Rubyforge:
36
+ - rubyibm project: http://rubyforge.org/projects/rubyibm/
37
+ - rubyibm forum: http://rubyforge.org/forum/?group_id=2361
38
+ - rubyibm bug reports: http://rubyforge.org/tracker/?group_id=2361
39
+ - IBM_DB developers: rubyibm-developers@rubyforge.org
data/README ADDED
@@ -0,0 +1,225 @@
1
+ =====================================================================
2
+ README for the IBM_DB Adapter (2.5.14) and Driver (2.5.14) (2014/02/11)
3
+ For ActiveRecord Version >= 1.15.5 (and Rails >= 1.2.5)
4
+ =====================================================================
5
+
6
+ Supported Operating Systems
7
+ ============================
8
+ - Linux 32/64 bit
9
+ - Microsoft Windows 32 bit
10
+ - IBM AIX 32/64 bit
11
+ - HP-UX 32/64 bit
12
+ - Sun Solaris 32/64 bit
13
+
14
+
15
+ Supported Databases
16
+ ====================
17
+ - IBM DB2 Universal Database on Linux/Unix/Windows versions 9 Fixpak2 and above
18
+ - Remote connections to IBM DB2 Universal Database on i5/OS versions V5R3 and V5R4.
19
+ Please ensure PTF SI27358 (includes SI27250) is installed in i5/OS version 5R3 and
20
+ and PTF SI27256 is installed while using i5/OS version 5R4.
21
+ - Remote connections to IBM DB2 Universal Database on z/OS version 8, 9 and 10
22
+ - Informix Dynamic Server 11.10 and beyond.
23
+ Please ensure that the IBM DataServer Viper 2 client is installed.
24
+
25
+
26
+ Installing the IBM_DB adapter and driver as a Ruby gem
27
+ =======================================================
28
+ The IBM_DB gem is an ActiveRecord adapter. Installing the IBM_DB adapter and driver as a gem enables any application in the
29
+ Ruby environment, including Rails, to interact with IBM data servers.
30
+
31
+ Note : - 1) If using activerecord version below 2.0 then it requires that the ibm_db adapter be registered with the list of connection adapters by manually adding ibm_db at line 77 (approx) in the file activerecord.rb (GEM_HOME\activerecord-<version>\lib\).
32
+
33
+ 2) The IBM_DB driver can also be built separately (from source) and used in direct API calls.
34
+
35
+ 1. Windows platforms:
36
+ =====================
37
+ INSTALL (as Ruby gem)
38
+ To remove previous gem version (optionally):
39
+ D:\>gem uninstall ibm_db
40
+ Successfully uninstalled ibm_db version 1.0.0
41
+
42
+ Example:
43
+ D:\>gem install ibm_db
44
+ Fetching: ibm_db-2.5.9-x86-mingw32.gem (100%)
45
+ Successfully installed ibm_db-2.5.9-x86-mingw32
46
+ 1 gem installed
47
+ Installing ri documentation for ibm_db-2.5.9-x86-mingw32...
48
+ Installing RDoc documentation for ibm_db-2.5.9-x86-mingw32...
49
+
50
+ Note:
51
+ 1) Currently Ruby-2.0 64-bit version on Windows is not supported as there are issues related to SQL definitions with the mingW compiler
52
+ [Details can be found here https://sourceforge.net/p/mingw/bugs/2041/ ].
53
+ Support will be enabled after the abive reported issue is resolved.
54
+
55
+ 2)The manual step after install if using activerecord version below 2.0:
56
+ add ibm_db into GEM_HOME\1.8\gems\activerecord-1.15.3\lib\active_record.rb (Line 77)
57
+
58
+ 2. Linux and Unix platforms:
59
+ ============================
60
+
61
+ INSTALL (as Ruby gem)
62
+ To remove previous gem version (optionally):
63
+ $ gem uninstall ibm_db
64
+ Successfully uninstalled ibm_db version 0.6.0
65
+
66
+ Note: DB2 environment is required while using an arbitrary user account
67
+ (other than the DB2 install user account)
68
+ $ . /home/db2inst1/sqllib/db2profile
69
+ $ export IBM_DB_HOME=DB2HOME (eg. /home/db2inst1/sqllib or /opt/ibm/db2/v9.5)
70
+ $ gem install ibm_db
71
+ Building native extensions. This could take a while...
72
+ Successfully installed ibm_db-2.5.9
73
+ 1 gem installed
74
+ Installing ri documentation for ibm_db-2.5.9...
75
+ Installing RDoc documentation for ibm_db-2.5.9...
76
+
77
+ BUILD (optionally) ibm_db gem from sources (ibm_db-x.x.x.tar.gz):
78
+ 1. Download source from Rubyforge
79
+ http://rubyforge.org/frs/?group_id=2361
80
+ 2. Build gem from specification (IBM_DB.gemspec)
81
+ $ cd IBM_DB_Adapter/ibm_db
82
+ $ gem build IBM_DB.gemspec
83
+
84
+ Note: The manual step after install if using activerecord version below 2.0:
85
+ add ibm_db into GEM_HOME\1.8\gems\activerecord-1.15.3\lib\active_record.rb (Line 77)
86
+
87
+ TEST (simple gem install verification)
88
+ ======================================
89
+ $ rails new myApp -d ibm_db
90
+ $ cd myApp
91
+ $ rails generate scaffold Wood name:string price:float
92
+ $ vi config/database.yml
93
+ $ rake db:migrate
94
+ $ rails console #rails server
95
+
96
+ Instructions for building and installing the IBM_DB driver from source
97
+ =======================================================================
98
+ Building the driver manually as described below is not required if the install
99
+ process above has been pursued. This manual procedure is in fact automated
100
+ on Linux and UNIX platforms by the IBM_DB gem install, but is presented
101
+ here only for reference.
102
+
103
+ Prerequisites:
104
+ Install Ruby from:
105
+ http://rubyforge.org
106
+
107
+ Setup the environment
108
+
109
+ Linux and Unix platforms:
110
+ Note: commands may vary depending on the shell used
111
+ - To setup DB2 environment while using an arbitrary user account
112
+ (other than the DB2 install user account):
113
+ Example:
114
+ $ . /home/db2inst1/sqllib/db2profile
115
+
116
+ - To compile and link with DB2 client libraries:
117
+ $ export IBM_DB_HOME=DB2HOME (eg. /home/db2inst1/sqllib or /opt/ibm/db2/v9.5)
118
+
119
+ Windows platforms:
120
+ - Set ruby devkit environment:
121
+ - To compile and link with DB2 client libraries:
122
+ $ set IBM_DB_HOME=DB2HOME (eg. C:\Program Files\IBM\SQLLIB)
123
+
124
+ Build the driver:
125
+ - $ cd rubyibm_source/IBM_DB_Adapter/ibm_db/ext
126
+ - $ ruby extconf.rb
127
+ - $ make
128
+
129
+ Build the ibm_db gem
130
+ - $ cp rubyibm_source/IBM_DB_Adapter/ibm_db/ext/ibm_db.so rubyibm_source/IBM_DB_Adapter/ibm_db/lib
131
+ # Not on windows separate binaries are generated for 1.8 and 1.9 version of ruby
132
+ # and placed under rb18x and rb19x directories respectively. The file ibm_db_mswin32.rb is renamed to ibm_db.rb to ensure proper binary is loaded based on runtime
133
+ # You will need to similarly ensure that the generated binary is placed on rb18x or rb19x directory under lib based on ruby version being used
134
+ - $ cd rubyibm_source/IBM_DB_Adapter/ibm_db
135
+ - $ gem build IBM_DB.gemspec
136
+
137
+ Running tests
138
+ =============
139
+ Testing the IBM_DB Adapter
140
+
141
+ 1) a) Copy the files under test directory of ibm_db gem to the test directory of Activerecord following the same directory structure.
142
+ These files contain modifications in some test files of AR suite to handle ibm_db specifics. Hence make sure these files are replaced in the AR test suite properly.
143
+ b) Rename warhouse-things.yml to warehouse_things.yml under fixtures directory
144
+ 2) Edit the Rakefile to include ibm_db in list of adapters
145
+ %w( mysql mysql2 postgresql sqlite3 sqlite3_mem firebird db2 oracle sybase openbase ibm_db frontbase jdbcmysql jdbcpostgresql jdbcsqlite3 jdbcderby jdbch2 jdbchsqldb )
146
+ 3) Configure the connection information in test/config.yml for ibm_db
147
+ 4) run the test suite - rake test_ibm_db
148
+
149
+ Running IBM_DB driver test suite
150
+
151
+ 1) Copy over the test directory under source to lib directory of installed ibm_db under $GEM_HOME
152
+ 2) Edit config.yml file to provide database connection information
153
+ 3) Run the test suite
154
+ $ rake onlytests
155
+ 4) To run single test
156
+ export SINGLE_RUBY_TEST=<test file name> #Eg: export SINGLE_RUBY_TEST=test_000_PrepareDb.rb
157
+ rake onlytests
158
+
159
+ Limitations and known problems
160
+ ==============================
161
+ - ActiveRecord remove_column method is not supported for DB2 zOS
162
+ - The driver returns an error when you try to insert a TIMESTAMP value into a DATE column.
163
+ To fix this, please ensure that the following configuration keyword PATCH2=58 is set
164
+ in the COMMON section of your DB2 CLI initialization file (db2cli.ini):
165
+ - set: db2 UPDATE CLI CFG FOR SECTION COMMON USING PATCH2 58
166
+ - verify: db2 GET CLI CFG FOR SECTION COMMON
167
+ Please refer to http://publib.boulder.ibm.com/infocenter/db2luw/v9/topic/com.ibm.db2.udb.apdv.cli.doc/doc/c0007882.htm
168
+ for more information.
169
+ - The behaviour of ActiveRecord::Base.find(:first) without an :order attribute can be unpredictable.
170
+ The first record (i.e. the record with the minimum id) may be not retrieved. In a relational model,
171
+ the order of the rows returned is unpredictable and independent of the order of insertion.
172
+ This issue may be addressed in a future release.
173
+ - Rails applications on DB2 9 require the APPLHEAPSZ database configuration parameter to be
174
+ set to or above 1024. You will need to set this parameter for each database for which you will be
175
+ running DB2 on Rails applications. Following is the command syntax for updating the
176
+ applheapsz parameter:
177
+ > db2 update db cfg for <database_name> using APPLHEAPSZ 1024
178
+ To enable this parameter, you need to restart your DB2 instance.
179
+ - If you see connectivity issues with Informix Dynamic Server, please ensure that the server is configured to accept DRDA connections.
180
+ Please refer to http://publib.boulder.ibm.com/infocenter/idshelp/v111/index.jsp?topic=/com.ibm.admin.doc/admin154.htm for more information.
181
+ - IBM_DB is not supported on JRuby. As stated in the JRuby Wiki, "Basics of Getting JRuby Running":
182
+ 'You may install other gems, but keep in mind that libraries with C extension dependencies
183
+ will not work in JRuby.' http://www.headius.com/jrubywiki/index.php/Getting_Started
184
+ The IBM_DB adapter relies on IBM_DB driver (C extension) and the IBM Driver for ODBC and
185
+ CLI to access databases on IBM data servers. Alternatively, you can either use the regular C
186
+ implementation of Ruby, or use ActiveRecord-JDBC adapter to access databases.
187
+ - When using ActiveRecord-2.1.0 it requires that ActiveRecord be patched, with the patch in the link below:
188
+ http://rails.lighthouseapp.com/attachments/26975/association_preloading.diff
189
+ The patch is required because, ActiveRecord 2.1.0 generates a non-standard SQL identifier,while preloading has_and_belongs_to_many associations,
190
+ which standard compliant databases like DB2 do not support. The bug report, against ActiveRecord, can be found in the link below
191
+ http://rails.lighthouseapp.com/projects/8994/tickets/394-patch-fixed-non-standard-sql-generated-by-preloading-has_and_belongs_to_many-associations
192
+ - The following tests from the ActiveRecord 2.1.0 test suite with ibm_db gem 0.10.0 are expected to fail on DB2 LUW
193
+ - test_read_attributes_before_type_cast_on_datetime
194
+ - test_to_xml
195
+ - test_native_types
196
+ - test_counting
197
+ - test_counting_with_column_name_and_hash
198
+ - test_counting_with_empty_hash_conditions
199
+ - test_counting_with_single_conditions
200
+ - test_counting_with_single_hash
201
+ Note :- 1) The test cases from HasManyAssociations (4-8) above are found failing only when run as part of
202
+ the complete suite. However they pass when run standalone.
203
+ 2) Also there are two test cases (test_validate_uniqueness_with_non_standard_table_names, test_update_all_with_non_standard_table_name)which run against table with non-standard name. Given that DB2/IDS is standard compliant these test cases are expected to fail.
204
+ To have these test cases passing rename the fixtures file warehouse-things to warehouse_things.
205
+ - Usage with Rails-3.0.3/Rails-3.0.4
206
+ - To use with Rails-3.0.3/4 patch latest Arel with the patch available at https://gist.github.com/814491
207
+
208
+ Unicode Support
209
+ ===============
210
+ - Available only with Ruby version 1.9 and above
211
+ - Data returned from the driver will be in UTF8 encoding format.
212
+ - The input data to the driver can be in any Ruby supported encoding format.
213
+
214
+ To Do
215
+ ====
216
+ - Support ActiveRecord remove_column method for DB2 zOS version 9
217
+
218
+
219
+ Feedback
220
+ ========
221
+ Your feedback is very much appreciated and expected through Rubyforge:
222
+ - rubyibm project: http://rubyforge.org/projects/rubyibm/
223
+ - rubyibm forum: http://rubyforge.org/forum/?group_id=2361
224
+ - rubyibm bug reports: http://rubyforge.org/tracker/?group_id=2361
225
+ - IBM_DB developers: rubyibm-developers@rubyforge.org