I know it’s no longer news for many, but for some it might still be: IBM_DB 0.6.5 gem refresh is available at rubyibm on RubyForge (prepackaged for win32/*nixes, and source code under MIT). This is the first refresh since the production/stable release 0.6.0, and contains a few important fixes for db:schema:dump/load for boolean, XML data type default option, and a reconnect regression. To refresh your environment is as simple as with any other Ruby gem: “gem install ibm_db”, and choose the appropriate platform of your choice (i.e. ‘mswin32’ for Windows, or ‘ruby’ for any *nix flavour). The online documentation also serves a few simple install verification examples, too.
And yes, this is the same IBM_DB2 adapter and driver you first encountered while installing Starter Toolkit. It evolved a bit though, it became more mature, fit to support all DB2 platforms (Linux, Unix, Windows, zOS and i5 systems), and ready to expand its support to other IBM data servers. In fact, the gem install now available makes it so easy, that you may want to give it a try whenever you have a couple of minutes.
Here’s another hint, if you already have access to a DB2 server, you might even be interested to try a “thin” DB2 client environment: IBM DB2 Driver for ODBC and CLI, and the Rails enablement IBM_DB 0.6.5 gem. And that makes you ready to test your Rails application prototypes on existing DB2 8 or 9 data servers. No, I really mean it, just go download latest FP2 for IBM DB2 Driver for ODBC and CLI, unzip and place its bin in the path, then install IBM_DB gem and kick-start your db:migrate for a test.
And if you need help or you find something unexpected, make sure IBM_DB developers hear from you through rubyibm Forum or Tracker.
Posted by Alex Pitigoi | May 16 2007 | Announcements | Comments Off
If you haven’t followed the IBM releases of DB2 on Rails very closely, you may be puzzled to find a Rubyforge project alongside the Alphaworks project. I’d like to shortly clarify what’s going on. The Stater Toolkit for DB2 on Rails is an easy, batteries included, one-click installer for Microsoft Windows and was last updated quite some time ago, when our driver and adapter were called IBM_DB2.
IBM’s vision of extending the driver and adapter not only to DB2 for LUW (Linux/Unix/Windows), but also for the other IBM databases, was clearly highlighted by the renaming of the DB2 enablement from IBM_DB2 to IBM_DB.
The new driver and adapter have been released in the Open Source on Rubyforge and they will be continuously improved and supported by IBM. Bugs, suggestions and questions should be posted directly on the homepage of the project at Rubyforge. This release allows users to install a gem or, if they prefer, to get a plugin on an individual project basis. So what will happen to the Alphaworks project?
An updated toolkit will be published very soon, and as you may expect it will automatically install the ibm_db gem along with Ruby, Rails, DB2 9 Fix Pack 2 and more. Windows users who already have several components installed, and users of other operating systems, can directly setup a DB2 development environment through the gem or the plugin, without requiring the toolkit. Others who prefer the comfort of a one click installer, will still find the starter toolkit to be an excellent solution to get everything setup including DB2 itself. If you are still uncertain about something, please feel free to use the comments to ask further questions.
Posted by Antonio Cangiano | May 10 2007 | Tips&Tricks | 4 Comments »
The Rails adapter and the Ruby driver for IBM DB2 enable you to take full advantage of the exclusive pureXML capabilities. XML fields are properly handled and also recognized when using migrations. We do not bind the content of XML columns to a specific XML Ruby representation (e.g. REXML) but rather let the user decide what they’d prefer to use, in light also of the fact that mapping to a simple string is often all that is required given the fast XQuery/XPath querying features provided out of the box by DB2.
The scaffolding generator ignores XML fields though. This is due to the fact that the bult-in scaffolding generates form elements for only a few datatypes. For example :time and :binary are excluded, and foreign keys are not handled as well. Users will typically want to handle XML fields in a customized way, for instance, showing only certain elements of the XML document in their forms. However if you wish to enable by default the automatic generation of text area boxes when using scaffolding, you can edit C:\ruby\lib\ruby\gems\1.8\gems\actionpack-1.12.5\lib\action_view\helpers\active _record_helper.rb (or the equivalent on your system) by replacing the to_tag method with the following:
def to_tag(options = {})
case column_type
when :string
field_type = @method_name.include?(”password”) ? “password” : “text”
to_input_field_tag(field_type, options)
when :text, :xml
to_text_area_tag(options)
when :integer, :float
to_input_field_tag(”text”, options)
when :date
to_date_select_tag(options)
when :datetime, :timestamp
to_datetime_select_tag(options)
when :boolean
to_boolean_select_tag(options)
end
end
As you can see, all we are doing here is adding the XML datatype to the list of cases which require the rendering of a text area box.
Posted by Antonio Cangiano | January 06 2007 | How-to and Tips&Tricks | 1 Comment »
« Prev - Next »