<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>DB2 on Rails &#187; How-to</title>
	<atom:link href="http://db2onrails.com/category/how-to/feed/" rel="self" type="application/rss+xml" />
	<link>http://db2onrails.com</link>
	<description>Agile development using Ruby on Rails for enterprises large and small</description>
	<lastBuildDate>Thu, 03 Dec 2009 18:58:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>DB2 on the new Rails Wiki</title>
		<link>http://db2onrails.com/2009/02/12/db2-on-the-new-rails-wiki/</link>
		<comments>http://db2onrails.com/2009/02/12/db2-on-the-new-rails-wiki/#comments</comments>
		<pubDate>Thu, 12 Feb 2009 05:17:55 +0000</pubDate>
		<dc:creator>Antonio Cangiano</dc:creator>
				<category><![CDATA[How-to]]></category>

		<guid isPermaLink="false">http://db2onrails.com/?p=66</guid>
		<description><![CDATA[The Rails team launched a new wiki, as the previous one had become way too messy. You can read about the reasons behind this choice in the official blog announcement. There wasn&#8217;t a DB2 page among the supported databases pages so I created one here. It covers the installation of the ibm_db gem, how to [...]]]></description>
			<content:encoded><![CDATA[<p>The Rails team launched <a href="http://newwiki.rubyonrails.org/">a new wiki</a>, as the previous one had become way too messy. You can read about the reasons behind this choice in the <a href="http://weblog.rubyonrails.org/2009/2/10/the-state-of-the-wiki">official blog announcement</a>. There wasn&#8217;t a DB2 page among the supported databases pages so I created one <a href="http://newwiki.rubyonrails.org/database-support/db2">here</a>. It covers the installation of the ibm_db gem, how to create a Rails app with a config/database.yml file prepopulated for DB2, and also provides a few helpful pointers. If you find any issues with it, please let us know or feel free to modify it yourself.</p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fdb2onrails.com%2F2009%2F02%2F12%2Fdb2-on-the-new-rails-wiki%2F&amp;title=DB2+on+the+new+Rails+Wiki" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fdb2onrails.com%2F2009%2F02%2F12%2Fdb2-on-the-new-rails-wiki%2F&amp;title=DB2+on+the+new+Rails+Wiki" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fdb2onrails.com%2F2009%2F02%2F12%2Fdb2-on-the-new-rails-wiki%2F&amp;title=DB2+on+the+new+Rails+Wiki" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fdb2onrails.com%2F2009%2F02%2F12%2Fdb2-on-the-new-rails-wiki%2F&amp;title=DB2+on+the+new+Rails+Wiki" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fdb2onrails.com%2F2009%2F02%2F12%2Fdb2-on-the-new-rails-wiki%2F&amp;title=DB2+on+the+new+Rails+Wiki', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fdb2onrails.com%2F2009%2F02%2F12%2Fdb2-on-the-new-rails-wiki%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fdb2onrails.com%2F2009%2F02%2F12%2Fdb2-on-the-new-rails-wiki%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fdb2onrails.com%2F2009%2F02%2F12%2Fdb2-on-the-new-rails-wiki%2F&amp;title=DB2+on+the+new+Rails+Wiki" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fdb2onrails.com%2F2009%2F02%2F12%2Fdb2-on-the-new-rails-wiki%2F&amp;title=DB2+on+the+new+Rails+Wiki" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>]]></content:encoded>
			<wfw:commentRss>http://db2onrails.com/2009/02/12/db2-on-the-new-rails-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using DB2 and Rails on Mac OS X</title>
		<link>http://db2onrails.com/2008/12/23/using-db2-and-rails-on-mac-os-x/</link>
		<comments>http://db2onrails.com/2008/12/23/using-db2-and-rails-on-mac-os-x/#comments</comments>
		<pubDate>Tue, 23 Dec 2008 23:38:44 +0000</pubDate>
		<dc:creator>Antonio Cangiano</dc:creator>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[How-to]]></category>

		<guid isPermaLink="false">http://db2onrails.com/?p=64</guid>
		<description><![CDATA[It was pre-announced over the weekend and has now been officially announced: DB2 Express-C for Mac OS X is finally available for download. To help get you started from the Rails side of things, this announcement also contains a few hints regarding how to set up your ibm_db stack and how to use it on [...]]]></description>
			<content:encoded><![CDATA[<p>It was pre-announced over the weekend and has now been officially announced: DB2 Express-C for Mac OS X is finally <a href="http://www.ibm.com/software/data/db2/express/download.html?S_CMP=ECDDWW01&#038;S_TACT=ACDB201">available for download</a>. To help get you started from the Rails side of things, <a href="http://antoniocangiano.com/2008/12/23/db2-on-mac-officially-released/">this announcement</a> also contains a few hints regarding how to set up your ibm_db stack and how to use it on our newest platform. Enjoy! <img src='http://db2onrails.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fdb2onrails.com%2F2008%2F12%2F23%2Fusing-db2-and-rails-on-mac-os-x%2F&amp;title=Using+DB2+and+Rails+on+Mac+OS+X" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fdb2onrails.com%2F2008%2F12%2F23%2Fusing-db2-and-rails-on-mac-os-x%2F&amp;title=Using+DB2+and+Rails+on+Mac+OS+X" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fdb2onrails.com%2F2008%2F12%2F23%2Fusing-db2-and-rails-on-mac-os-x%2F&amp;title=Using+DB2+and+Rails+on+Mac+OS+X" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fdb2onrails.com%2F2008%2F12%2F23%2Fusing-db2-and-rails-on-mac-os-x%2F&amp;title=Using+DB2+and+Rails+on+Mac+OS+X" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fdb2onrails.com%2F2008%2F12%2F23%2Fusing-db2-and-rails-on-mac-os-x%2F&amp;title=Using+DB2+and+Rails+on+Mac+OS+X', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fdb2onrails.com%2F2008%2F12%2F23%2Fusing-db2-and-rails-on-mac-os-x%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fdb2onrails.com%2F2008%2F12%2F23%2Fusing-db2-and-rails-on-mac-os-x%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fdb2onrails.com%2F2008%2F12%2F23%2Fusing-db2-and-rails-on-mac-os-x%2F&amp;title=Using+DB2+and+Rails+on+Mac+OS+X" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fdb2onrails.com%2F2008%2F12%2F23%2Fusing-db2-and-rails-on-mac-os-x%2F&amp;title=Using+DB2+and+Rails+on+Mac+OS+X" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>]]></content:encoded>
			<wfw:commentRss>http://db2onrails.com/2008/12/23/using-db2-and-rails-on-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Common pitfalls when installing the ibm_db gem</title>
		<link>http://db2onrails.com/2008/11/11/common-pitfalls-when-installing-the-ibm_db-gem/</link>
		<comments>http://db2onrails.com/2008/11/11/common-pitfalls-when-installing-the-ibm_db-gem/#comments</comments>
		<pubDate>Tue, 11 Nov 2008 21:13:02 +0000</pubDate>
		<dc:creator>Antonio Cangiano</dc:creator>
				<category><![CDATA[How-to]]></category>
		<category><![CDATA[Tips&Tricks]]></category>

		<guid isPermaLink="false">http://db2onrails.com/?p=58</guid>
		<description><![CDATA[Installing the ibm_db gem on Windows is as easy as running gem install ibm_db. Next to no problems have been reported, as the the installation is as smooth as it gets. On Linux things can get a bit trickier though. Having helped dozens of people resolve installation problems, I&#8217;ve gathered some insight into what the [...]]]></description>
			<content:encoded><![CDATA[<p>Installing the ibm_db gem on Windows is as easy as running <code>gem install ibm_db</code>. Next to no problems have been reported, as the the installation is as smooth as it gets. On Linux things can get a bit trickier though. Having helped dozens of people resolve installation problems, I&#8217;ve gathered some insight into what the common pitfalls are when installing the ibm_db gem on *nix systems. Here I&#8217;ve put together a checklist, in case you&#8217;re experiencing issues with your own install.</p>
<p>First and foremost, the most common error message is a variant of the following:</p>
<pre><code>
$ sudo gem install ibm_db
Building native extensions.  This could take a while...
ERROR:  Error installing ibm_db:
	ERROR: Failed to build gem native extension.

/usr/bin/ruby1.8 extconf.rb install ibm_db
checking for SQLConnect() in -ldb2... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
	--with-opt-dir
	--without-opt-dir
	--with-opt-include
	--without-opt-include=${opt-dir}/include
	--with-opt-lib
	--without-opt-lib=${opt-dir}/lib
  ...
  ...
</code></pre>
<p>The gem fails to install because the <code>SQLConnect()</code> function provided by DB2&#8217;s development headers (which are required to build the gem) cannot be found/loaded.</p>
<p>This brings us to our quick checklist:</p>
<p><strong>1.</strong> Have you sourced the profile? This is done by running:</p>
<pre><code>. /home/db2inst1/sqllib/db2profile</code></pre>
<p>You may need to replace the dot, with <code>source</code> depending on your shell.</p>
<p><strong>2.</strong> Have you specified where DB2&#8217;s directory and library are to be found? You can do so by running:</p>
<pre><code>
export IBM_DB_DIR=/home/db2inst1/sqllib
export IBM_DB_LIB=/home/db2inst1/sqllib/lib32
</code></pre>
<p><strong>3.</strong> Did you install the required development headers during the installation? These are available by selecting &#8220;Base application development tools&#8221; under the section &#8220;Application Development Tools&#8221; in the DB2 Setup Wizard (having selected a &#8220;custom&#8221; installation beforehand).</p>
<p>You can double check this by running:</p>
<pre><code>ls /home/db2inst1/sqllib/include</code></pre>
<p>This should show you a series of .h files, including sqlcli1.h. If you don&#8217;t see them, then you need to repeat the setup procedure so as to add the development tools. Likewise, you should also see a series of .so files, including<br />
libdb2.so when you run: <code>ls /home/db2inst1/sqllib/lib32</code>.</p>
<p><strong>4.</strong> Are you trying to perform the installation when logged in as the db2inst1 user? If you&#8217;re doing this, it&#8217;s best not to. It doesn&#8217;t matter if db2inst1 is a suoder or not. Don&#8217;t run <code>sudo gem install ibm_db</code> as the instance user.</p>
<p><strong>5.</strong> If nothing else works, try to install as the root user (on certain systems <code>sudo</code> won&#8217;t cut it). The following complete procedure works in 99% of cases:</p>
<pre><code>
sudo -s
. /home/db2inst1/sqllib/db2profile
export IBM_DB_DIR=/home/db2inst1/sqllib
export IBM_DB_LIB=/home/db2inst1/sqllib/lib32
gem install ibm_db
</code></pre>
<p>If this checklist doesn&#8217;t help you, then you can reach for the <a href="http://rubyforge.org/forum/forum.php?forum_id=9503">RubyForge forum</a>, where the DB2 on Rails community and the IBM team will be happy to help you.</p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fdb2onrails.com%2F2008%2F11%2F11%2Fcommon-pitfalls-when-installing-the-ibm_db-gem%2F&amp;title=Common+pitfalls+when+installing+the+ibm_db+gem" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fdb2onrails.com%2F2008%2F11%2F11%2Fcommon-pitfalls-when-installing-the-ibm_db-gem%2F&amp;title=Common+pitfalls+when+installing+the+ibm_db+gem" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fdb2onrails.com%2F2008%2F11%2F11%2Fcommon-pitfalls-when-installing-the-ibm_db-gem%2F&amp;title=Common+pitfalls+when+installing+the+ibm_db+gem" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fdb2onrails.com%2F2008%2F11%2F11%2Fcommon-pitfalls-when-installing-the-ibm_db-gem%2F&amp;title=Common+pitfalls+when+installing+the+ibm_db+gem" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fdb2onrails.com%2F2008%2F11%2F11%2Fcommon-pitfalls-when-installing-the-ibm_db-gem%2F&amp;title=Common+pitfalls+when+installing+the+ibm_db+gem', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fdb2onrails.com%2F2008%2F11%2F11%2Fcommon-pitfalls-when-installing-the-ibm_db-gem%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fdb2onrails.com%2F2008%2F11%2F11%2Fcommon-pitfalls-when-installing-the-ibm_db-gem%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fdb2onrails.com%2F2008%2F11%2F11%2Fcommon-pitfalls-when-installing-the-ibm_db-gem%2F&amp;title=Common+pitfalls+when+installing+the+ibm_db+gem" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fdb2onrails.com%2F2008%2F11%2F11%2Fcommon-pitfalls-when-installing-the-ibm_db-gem%2F&amp;title=Common+pitfalls+when+installing+the+ibm_db+gem" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>]]></content:encoded>
			<wfw:commentRss>http://db2onrails.com/2008/11/11/common-pitfalls-when-installing-the-ibm_db-gem/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>New support for Rails 2.1</title>
		<link>http://db2onrails.com/2008/06/26/new-support-for-rails-21/</link>
		<comments>http://db2onrails.com/2008/06/26/new-support-for-rails-21/#comments</comments>
		<pubDate>Thu, 26 Jun 2008 21:40:08 +0000</pubDate>
		<dc:creator>Antonio Cangiano</dc:creator>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[How-to]]></category>

		<guid isPermaLink="false">http://db2onrails.com/?p=47</guid>
		<description><![CDATA[Support for Rails 2.1 has been added to the latest version of the ibm_db gem (0.9.5). To install this version run gem install ibm_db on Windows. On Linux run the following:

$ . /home/db2inst1/db2profile
$ export IBM_DB_DIR=/opt/ibm/db2/V9.5
$ export IBM_DB_LIB=/opt/ibm/db2/V9.5/lib32
$ sudo gem install ibm_db

Adjust these commands for your paths, shell and architecture (e.g. 32 vs. 64 bits).
Please note [...]]]></description>
			<content:encoded><![CDATA[<p>Support for Rails 2.1 has been added to the latest version of the ibm_db gem (0.9.5). To install this version run <code>gem install ibm_db</code> on Windows. On Linux run the following:</p>
<pre>
$ . /home/db2inst1/db2profile
$ export IBM_DB_DIR=/opt/ibm/db2/V9.5
$ export IBM_DB_LIB=/opt/ibm/db2/V9.5/lib32
$ sudo gem install ibm_db
</pre>
<p>Adjust these commands for your paths, shell and architecture (e.g. 32 vs. 64 bits).</p>
<p>Please note that at this stage we don&#8217;t recommend that you download the outdated Starter Toolkit for DB2 on Rails. Instead, please <a href="http://www-306.ibm.com/software/data/db2/express/download.html?S_CMP=ECDDWW01&#038;S_TACT=ACDB202">grab and install DB2 Express-C</a>, install Ruby through the <a href="http://rubyforge.org/projects/rubyinstaller/">One-Click Installer</a>, install Rails through gems (<code>gem install rails</code>) and then proceed to install the ibm_db gem as explained above. When you install DB2, ensure to select the &#8220;Base application development tools&#8221; as illustrated <a href="http://antoniocangiano.com/rubypython-and-db2-drivers/">here</a>.</p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fdb2onrails.com%2F2008%2F06%2F26%2Fnew-support-for-rails-21%2F&amp;title=New+support+for+Rails+2.1" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fdb2onrails.com%2F2008%2F06%2F26%2Fnew-support-for-rails-21%2F&amp;title=New+support+for+Rails+2.1" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fdb2onrails.com%2F2008%2F06%2F26%2Fnew-support-for-rails-21%2F&amp;title=New+support+for+Rails+2.1" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fdb2onrails.com%2F2008%2F06%2F26%2Fnew-support-for-rails-21%2F&amp;title=New+support+for+Rails+2.1" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fdb2onrails.com%2F2008%2F06%2F26%2Fnew-support-for-rails-21%2F&amp;title=New+support+for+Rails+2.1', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fdb2onrails.com%2F2008%2F06%2F26%2Fnew-support-for-rails-21%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fdb2onrails.com%2F2008%2F06%2F26%2Fnew-support-for-rails-21%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fdb2onrails.com%2F2008%2F06%2F26%2Fnew-support-for-rails-21%2F&amp;title=New+support+for+Rails+2.1" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fdb2onrails.com%2F2008%2F06%2F26%2Fnew-support-for-rails-21%2F&amp;title=New+support+for+Rails+2.1" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>]]></content:encoded>
			<wfw:commentRss>http://db2onrails.com/2008/06/26/new-support-for-rails-21/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Essential guide for the Ruby driver</title>
		<link>http://db2onrails.com/2008/02/08/essential-guide-for-the-ruby-driver/</link>
		<comments>http://db2onrails.com/2008/02/08/essential-guide-for-the-ruby-driver/#comments</comments>
		<pubDate>Fri, 08 Feb 2008 08:52:34 +0000</pubDate>
		<dc:creator>Antonio Cangiano</dc:creator>
				<category><![CDATA[How-to]]></category>

		<guid isPermaLink="false">http://db2onrails.com/2008/02/08/essential-guide-for-the-ruby-driver/</guid>
		<description><![CDATA[In the past couple of months, I received a fairly large number of requests about how to use the IBM_DB Ruby driver to query DB2. So I decided to create an essential guide for using the Ruby DB2 driver. Amongst the topics I covered, there are: connecting to the database (local or remote), executing queries, [...]]]></description>
			<content:encoded><![CDATA[<p>In the past couple of months, I received a fairly large number of requests about how to use the IBM_DB Ruby driver to query DB2. So I decided to create <a href="http://antoniocangiano.com/2008/02/08/essential-guide-to-the-ruby-driver-for-db2/">an essential guide for using the Ruby DB2 driver</a>. Amongst the topics I covered, there are: connecting to the database (local or remote), executing queries, retrieving connection and execution errors, fetching results, using prepared statements for parameterized queries and finally how to use the driver for dealing with stored procedures. That should be more than enough to get your started with the driver and, even if it&#8217;s about Ruby and not Rails, it will be beneficial to those who develop DB2 on Rails applications.</p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fdb2onrails.com%2F2008%2F02%2F08%2Fessential-guide-for-the-ruby-driver%2F&amp;title=Essential+guide+for+the+Ruby+driver" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fdb2onrails.com%2F2008%2F02%2F08%2Fessential-guide-for-the-ruby-driver%2F&amp;title=Essential+guide+for+the+Ruby+driver" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fdb2onrails.com%2F2008%2F02%2F08%2Fessential-guide-for-the-ruby-driver%2F&amp;title=Essential+guide+for+the+Ruby+driver" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fdb2onrails.com%2F2008%2F02%2F08%2Fessential-guide-for-the-ruby-driver%2F&amp;title=Essential+guide+for+the+Ruby+driver" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fdb2onrails.com%2F2008%2F02%2F08%2Fessential-guide-for-the-ruby-driver%2F&amp;title=Essential+guide+for+the+Ruby+driver', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fdb2onrails.com%2F2008%2F02%2F08%2Fessential-guide-for-the-ruby-driver%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fdb2onrails.com%2F2008%2F02%2F08%2Fessential-guide-for-the-ruby-driver%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fdb2onrails.com%2F2008%2F02%2F08%2Fessential-guide-for-the-ruby-driver%2F&amp;title=Essential+guide+for+the+Ruby+driver" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fdb2onrails.com%2F2008%2F02%2F08%2Fessential-guide-for-the-ruby-driver%2F&amp;title=Essential+guide+for+the+Ruby+driver" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>]]></content:encoded>
			<wfw:commentRss>http://db2onrails.com/2008/02/08/essential-guide-for-the-ruby-driver/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to setup the Ruby driver for DB2 on Linux</title>
		<link>http://db2onrails.com/2007/11/15/how-to-setup-the-ruby-driver-for-db2-on-linux/</link>
		<comments>http://db2onrails.com/2007/11/15/how-to-setup-the-ruby-driver-for-db2-on-linux/#comments</comments>
		<pubDate>Thu, 15 Nov 2007 20:09:59 +0000</pubDate>
		<dc:creator>Antonio Cangiano</dc:creator>
				<category><![CDATA[How-to]]></category>

		<guid isPermaLink="false">http://db2onrails.com/2007/11/15/how-to-setup-the-ruby-driver-for-db2-on-linux/</guid>
		<description><![CDATA[Yesterday I wrote a short guide to setting up DB2 9.5, Ruby and the IBM_DB driver on Linux (32 or 64 bits), and published it on my personal blog. I didn&#8217;t host it on DB2onRails.com since it also covers the installation of the newly released Python driver, a subject somewhat off-topic for this blog. That [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday I wrote a short guide to setting up DB2 9.5, Ruby and the IBM_DB driver on Linux (32 or 64 bits), and published it on my personal blog. I didn&#8217;t host it on DB2onRails.com since it also covers the installation of the newly released Python driver, a subject somewhat off-topic for this blog. That said, the step-by-step instructions provided for Ubuntu 7.10 may be very useful to many of our Ruby users following this blog. If you&#8217;re experiencing problems with the installation of DB2 9.5 or the ibm_db Ruby gem on Linux, check out <a href="http://antoniocangiano.com/rubypython-and-db2-drivers/">Guide to setting up the IBM Ruby and Python drivers for DB2 on Linux (32 or 64 bit)</a> for help.</p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fdb2onrails.com%2F2007%2F11%2F15%2Fhow-to-setup-the-ruby-driver-for-db2-on-linux%2F&amp;title=How+to+setup+the+Ruby+driver+for+DB2+on+Linux" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fdb2onrails.com%2F2007%2F11%2F15%2Fhow-to-setup-the-ruby-driver-for-db2-on-linux%2F&amp;title=How+to+setup+the+Ruby+driver+for+DB2+on+Linux" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fdb2onrails.com%2F2007%2F11%2F15%2Fhow-to-setup-the-ruby-driver-for-db2-on-linux%2F&amp;title=How+to+setup+the+Ruby+driver+for+DB2+on+Linux" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fdb2onrails.com%2F2007%2F11%2F15%2Fhow-to-setup-the-ruby-driver-for-db2-on-linux%2F&amp;title=How+to+setup+the+Ruby+driver+for+DB2+on+Linux" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fdb2onrails.com%2F2007%2F11%2F15%2Fhow-to-setup-the-ruby-driver-for-db2-on-linux%2F&amp;title=How+to+setup+the+Ruby+driver+for+DB2+on+Linux', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fdb2onrails.com%2F2007%2F11%2F15%2Fhow-to-setup-the-ruby-driver-for-db2-on-linux%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fdb2onrails.com%2F2007%2F11%2F15%2Fhow-to-setup-the-ruby-driver-for-db2-on-linux%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fdb2onrails.com%2F2007%2F11%2F15%2Fhow-to-setup-the-ruby-driver-for-db2-on-linux%2F&amp;title=How+to+setup+the+Ruby+driver+for+DB2+on+Linux" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fdb2onrails.com%2F2007%2F11%2F15%2Fhow-to-setup-the-ruby-driver-for-db2-on-linux%2F&amp;title=How+to+setup+the+Ruby+driver+for+DB2+on+Linux" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>]]></content:encoded>
			<wfw:commentRss>http://db2onrails.com/2007/11/15/how-to-setup-the-ruby-driver-for-db2-on-linux/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Troubleshooting DB2 on Rails</title>
		<link>http://db2onrails.com/2007/10/19/troubleshooting-db2-on-rails/</link>
		<comments>http://db2onrails.com/2007/10/19/troubleshooting-db2-on-rails/#comments</comments>
		<pubDate>Fri, 19 Oct 2007 05:07:40 +0000</pubDate>
		<dc:creator>Antonio Cangiano</dc:creator>
				<category><![CDATA[How-to]]></category>
		<category><![CDATA[Tips&Tricks]]></category>

		<guid isPermaLink="false">http://db2onrails.com/2007/10/19/troubleshooting-db2-on-rails/</guid>
		<description><![CDATA[DB2 on Rails provides the developer with many ways to retrieve information about errors which have occurred. Rails developers can take a look at the logs within the log folder in order to read the SQL errors returned by the datasever. But what about simple Ruby scripts? Let&#8217;s try to connect to DB2 with the [...]]]></description>
			<content:encoded><![CDATA[<p>DB2 on Rails provides the developer with many ways to retrieve information about errors which have occurred. Rails developers can take a look at the logs within the log folder in order to read the SQL errors returned by the datasever. But what about simple Ruby scripts? Let&#8217;s try to connect to DB2 with the wrong user credentials:</p>
<pre class="db2code"><code>conn = IBM_DB::connect("mydb","myuser","my_wrong_pass")
#=&gt; false</pre>
<p></code></p>
<p><code>false</code>. That doesn't really help us too much. We know that something went wrong, but we don't exactly know what. Luckily for us, the IBM_DB driver gives us all the tools that we need to properly troubleshoot problems. The example above can be rewritten in this way:</p>
<pre class="db2code">
<code>if conn = IBM_DB::connect("mydb","myuser","my_wrong_pass")
  # do something interesting
else
  # conn is false
  raise IBM_DB::conn_errormsg
end
#=&gt; RuntimeError: [IBM][CLI Driver] SQL30082N Security processing failed with reason
"24" ("USERNAME AND/OR PASSWORD INVALID").  SQLSTATE=08001 SQLCODE=-30082</code>
</pre>
<p>Okay, that should have us covered when it comes to failed attempts to connect to the database, but what about failed queries? Analogously, the IBM_DB driver provides us with the <code>IBM_DB::stmt_errormsg</code> method:</p>
<pre  class="db2code">
<code>if stmt = IBM_DB::exec(conn, "SELECT * FROM WRONG_TABLE)
  # process the results
else
  # stmt is false
  raise IBM_DB::stmt_errormsg
end
#=&gt; RuntimeError: =&gt; [IBM][CLI Driver][DB2/NT] SQL0204N " DB2ADMIN.WRONG_TABLE" is
an undefined name.  SQLSTATE=42704 SQLCODE=-204</code>
    </pre>
<p>DB2 error messages are usually easy to understand and with a bit of help from the <a href=" http://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp">DB2 Information Center</a> you should be able to get out of trouble most of the time.</p>
<p>    <strong>DB2 CLI Tracing</strong></p>
<p>Despite the helpful error messages, there are situations in which troubleshooting can be hard because everything seems to be in the right place but your application is still acting up for some reason. The ultimate tool when it comes to troubleshooting for DB2 and Ruby/Rails application problems is to enable DB2 CLI (Call Level Interface) tracing. The CLI trace captures information about applications that access the DB2 CLI driver. Tracing gives you the ability to analyze low level calls to the C driver API with details on the input and output, to and from the database. The resulting trace is not particularly easy to understand for a DB2 novice, but it can offer a microscopic view which is invaluable for understanding problems that are hidden by the abstractions of higher level APIs, and allow you to see to a certain degree what's happening under the hood.</p>
<p>The two free PDFs, <em>Call Level Interface Guide and Reference</em>, <a href=" ftp://ftp.software.ibm.com/ps/products/db2/info/vr9/pdf/letter/en_US/db2l1e90.pdf ">Volume 1</a> and <a href="ftp://ftp.software.ibm.com/ps/products/db2/info/vr9/pdf/letter/en_US/db2l2e90.pdf ">Volume 2</a> are the best references if you need to look up calls in your CLI trace files. Instructions on how to enable CLI level tracing for DB2 Express-C LUW (Linux/Unix/Windows) can be found <a href=" http://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp?topic=/com.ibm.db2.udb.pd.doc/doc/c0020795.htm ">here</a>.</p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fdb2onrails.com%2F2007%2F10%2F19%2Ftroubleshooting-db2-on-rails%2F&amp;title=Troubleshooting+DB2+on+Rails" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fdb2onrails.com%2F2007%2F10%2F19%2Ftroubleshooting-db2-on-rails%2F&amp;title=Troubleshooting+DB2+on+Rails" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fdb2onrails.com%2F2007%2F10%2F19%2Ftroubleshooting-db2-on-rails%2F&amp;title=Troubleshooting+DB2+on+Rails" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fdb2onrails.com%2F2007%2F10%2F19%2Ftroubleshooting-db2-on-rails%2F&amp;title=Troubleshooting+DB2+on+Rails" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fdb2onrails.com%2F2007%2F10%2F19%2Ftroubleshooting-db2-on-rails%2F&amp;title=Troubleshooting+DB2+on+Rails', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fdb2onrails.com%2F2007%2F10%2F19%2Ftroubleshooting-db2-on-rails%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fdb2onrails.com%2F2007%2F10%2F19%2Ftroubleshooting-db2-on-rails%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fdb2onrails.com%2F2007%2F10%2F19%2Ftroubleshooting-db2-on-rails%2F&amp;title=Troubleshooting+DB2+on+Rails" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fdb2onrails.com%2F2007%2F10%2F19%2Ftroubleshooting-db2-on-rails%2F&amp;title=Troubleshooting+DB2+on+Rails" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>]]></content:encoded>
			<wfw:commentRss>http://db2onrails.com/2007/10/19/troubleshooting-db2-on-rails/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>rake db:test:purge and rake db:test:clone</title>
		<link>http://db2onrails.com/2007/06/20/rake-db-test-purge-and-rake-db-test-clone/</link>
		<comments>http://db2onrails.com/2007/06/20/rake-db-test-purge-and-rake-db-test-clone/#comments</comments>
		<pubDate>Wed, 20 Jun 2007 18:30:00 +0000</pubDate>
		<dc:creator>Antonio Cangiano</dc:creator>
				<category><![CDATA[How-to]]></category>

		<guid isPermaLink="false">http://db2onrails.com/2007/06/20/rake-db-test-purge-and-rake-db-test-clone/</guid>
		<description><![CDATA[With an increasing number of Rails developers adopting DB2 as their database of choice, and the welcoming approach towards suggestions and requests on our end, it comes as no surprise that the feedback is rolling in faster than ever. We are very pleased about this, and in this short article I’d love to address two [...]]]></description>
			<content:encoded><![CDATA[<p>With an increasing number of Rails developers adopting <span class="caps">DB2</span> as their database of choice, and the welcoming approach towards suggestions and requests on our end, it comes as no surprise that the feedback is rolling in faster than ever. We are very pleased about this, and in this short article I’d love to address two of the most requested features.</p>
<h3>rake db:test:purge</h3>
<p>Running rake db:test:purge generates the following error:</p>
<p><code></code></p>
<pre>
  rake aborted!
  Task not supported by 'ibm_db'</pre>
<p>db:test:purge is a rake task defined in the Rails gem within the file rails-1.2.3/lib/tasks/databases.rake. This file takes care of, amongst other things, defining the specific behavior for each database adapter known to rails, when the user requests a database purge. It is essentially a big case statement with specific ruby code which drops all the user objects from the supported database.</p>
<p>ibm_db is currently shipped independently from Rails, therefore it is missing from that case statement, and as a result the task will appear to not be supported by ibm_db.</p>
<p>If you are using the ibm_db adapter for <span class="caps">DB2</span>, you don’t want to miss the opportunity to use rake db:test:purge and take advantage of other tasks that rely on this in order to work. What you can do is, manually insert a snippet of code for the ibm_db case in databases.rake.</p>
<p>An easy and straightforward implementation of this would be dropping the database and recreating it from scratch. I’m not allowed into the other adapters implementations, but I assume this could be what some of the other adapters may be doing. I believe this is not the right thing to do with <span class="caps">DB2</span> though. In fact, this would have two main drawbacks. Firstly, creating a database every time, implies that the task becomes quite slow, because the creation of a database in <span class="caps">DB2</span> is a “magical process” that can take up to a minute (for good reason, and that minute can save you lots of money in the years to come as you use the database). Secondly, the database that you have created in the first place may have many options and parameters configured, and collecting them all and reapplying them may not be the easiest or the smartest thing to do.</p>
<p>A different approach would be to handle this the right way, by dropping all the user schemas and the objects contained within the database. The code needs to be placed within the case statement we mentioned above:</p>
<p class="typocode">
<pre><code class="typocode_ruby">    <span class="ident">desc</span> <span class="punct">"</span><span class="string">Empty the test database</span><span class="punct">"</span>
    <span class="ident">task</span> <span class="symbol">:purge</span> <span class="punct">=&gt;</span> <span class="symbol">:environment</span> <span class="keyword">do</span>
      <span class="ident">abcs</span> <span class="punct">=</span> <span class="constant">ActiveRecord</span><span class="punct">::</span><span class="constant">Base</span><span class="punct">.</span><span class="ident">configurations</span>
      <span class="keyword">case</span> <span class="ident">abcs</span><span class="punct">["</span><span class="string">test</span><span class="punct">"]["</span><span class="string">adapter</span><span class="punct">"]</span>
        <span class="comment">#...</span>
      <span class="keyword">end</span>
   <span class="keyword">end</span></code></pre>
<p>With the current (Rails 1.2.3) databases.rake you can practically just copy and paste the following code at line 145 in the file:</p>
<p class="typocode">
<pre><code class="typocode_ruby"><span class="keyword">when</span> <span class="punct">"</span><span class="string">ibm_db</span><span class="punct">"</span>
  <span class="constant">ActiveRecord</span><span class="punct">::</span><span class="constant">Base</span><span class="punct">.</span><span class="ident">establish_connection</span><span class="punct">(</span><span class="symbol">:test</span><span class="punct">)</span>
  <span class="ident">conn</span> <span class="punct">=</span> <span class="constant">ActiveRecord</span><span class="punct">::</span><span class="constant">Base</span><span class="punct">.</span><span class="ident">connection</span><span class="punct">.</span><span class="ident">connection</span>

  <span class="keyword">begin</span>
    <span class="comment"># Required for the stored procedure ADMIN_DROP_SCHEMA</span>
    <span class="constant">ActiveRecord</span><span class="punct">::</span><span class="constant">Base</span><span class="punct">.</span><span class="ident">connection</span><span class="punct">.</span><span class="ident">execute</span><span class="punct">("</span><span class="string">CREATE TABLESPACE SYSTOOLSPACE</span><span class="punct">")</span>
    <span class="ident">systool_existing</span> <span class="punct">=</span> <span class="constant">false</span>
  <span class="keyword">rescue</span>
    <span class="comment"># The SYSTOOLSPAGE already exists</span>
    <span class="ident">systool_existing</span> <span class="punct">=</span> <span class="constant">true</span>
  <span class="keyword">end</span>

  <span class="comment"># Collects all the user defined schemas</span>
  <span class="ident">user_schemas_sql</span> <span class="punct">=</span> <span class="punct">"</span><span class="string">SELECT SCHEMANAME FROM SYSCAT.SCHEMATA WHERE DEFINER &lt;&gt; 'SYSIBM' AND <span class="escape">
</span>  SCHEMANAME NOT IN ('NULLID', 'ERRORSCHEMA', 'SYSTOOLS')</span><span class="punct">"</span>
  <span class="ident">schemas</span> <span class="punct">=</span> <span class="constant">ActiveRecord</span><span class="punct">::</span><span class="constant">Base</span><span class="punct">.</span><span class="ident">connection</span><span class="punct">.</span><span class="ident">select_all</span><span class="punct">(</span><span class="ident">user_schemas_sql</span><span class="punct">)</span>

  <span class="keyword">unless</span> <span class="ident">schemas</span><span class="punct">.</span><span class="ident">empty?</span>
    <span class="ident">errortabschema</span> <span class="punct">=</span> <span class="punct">'</span><span class="string">ERRORSCHEMA</span><span class="punct">'</span>
    <span class="ident">errortab</span> <span class="punct">=</span> <span class="punct">'</span><span class="string">ERRORTABLE</span><span class="punct">'</span>

    <span class="comment"># Drop each schema and all its objects</span>
    <span class="ident">schemas</span><span class="punct">.</span><span class="ident">each</span> <span class="keyword">do</span> <span class="punct">|</span><span class="ident">schema</span><span class="punct">|</span>
      <span class="ident">schema_name</span> <span class="punct">=</span> <span class="ident">schema</span><span class="punct">["</span><span class="string">schemaname</span><span class="punct">"].</span><span class="ident">strip</span><span class="punct">.</span><span class="ident">upcase</span>
      <span class="ident">sql</span> <span class="punct">=</span> <span class="punct">"</span><span class="string">CALL SYSPROC.ADMIN_DROP_SCHEMA('<span class="expr">#{schema_name}</span>', NULL, ?, ?)</span><span class="punct">"</span>
      <span class="ident">stmt</span> <span class="punct">=</span> <span class="constant">IBM_DB</span><span class="punct">::</span><span class="ident">prepare</span><span class="punct">(</span><span class="ident">conn</span><span class="punct">,</span> <span class="ident">sql</span><span class="punct">)</span>
      <span class="constant">IBM_DB</span><span class="punct">::</span><span class="ident">bind_param</span><span class="punct">(</span><span class="ident">stmt</span><span class="punct">,</span> <span class="number">1</span><span class="punct">,</span> <span class="punct">"</span><span class="string">errortabschema</span><span class="punct">",</span> <span class="constant">IBM_DB</span><span class="punct">::</span><span class="constant">SQL_PARAM_INPUT</span><span class="punct">)</span>
      <span class="constant">IBM_DB</span><span class="punct">::</span><span class="ident">bind_param</span><span class="punct">(</span><span class="ident">stmt</span><span class="punct">,</span> <span class="number">2</span><span class="punct">,</span> <span class="punct">"</span><span class="string">errortab</span><span class="punct">",</span> <span class="constant">IBM_DB</span><span class="punct">::</span><span class="constant">SQL_PARAM_INPUT</span><span class="punct">)</span>
      <span class="constant">IBM_DB</span><span class="punct">::</span><span class="ident">execute</span><span class="punct">(</span><span class="ident">stmt</span><span class="punct">)</span>
    <span class="keyword">end</span>

    <span class="comment"># If the tablespace SYSTOOLSPACE didn't exist initially, it gets dropped  </span>
    <span class="constant">ActiveRecord</span><span class="punct">::</span><span class="constant">Base</span><span class="punct">.</span><span class="ident">connection</span><span class="punct">.</span><span class="ident">execute</span><span class="punct">("</span><span class="string">DROP TABLESPACE SYSTOOLSPACE</span><span class="punct">")</span> <span class="keyword">unless</span> <span class="ident">systool_existing</span>

    <span class="comment"># Drops the remaining schema "ERRORSCHEMA"</span>
    <span class="constant">ActiveRecord</span><span class="punct">::</span><span class="constant">Base</span><span class="punct">.</span><span class="ident">connection</span><span class="punct">.</span><span class="ident">execute</span><span class="punct">("</span><span class="string">DROP SCHEMA ERRORSCHEMA RESTRICT</span><span class="punct">")</span>
  <span class="keyword">end</span></code></pre>
<p>This can also be used do define a method on its own (e.g. purge_database(:mydb)), should you require that functionality somewhere in your code. In that case, just make sure to modify the first lines in order to use the already established connection or define your own.</p>
<h3>rake db:test:clone</h3>
<p>Now that rake db:test:purge is working, you will be able to successfully run rake db:test:clone. Out of the box, there are two limitations though. Rails doesn’t acknowledge tablespaces and foreign keys (the lack of the first is understandable as it is strongly related to <span class="caps">DB2</span>, but the lack of the second is much less justifiable).</p>
<p>This doesn’t affect many developers but if it does affect you, it is both annoying and problematic. Suppose in fact, that you have created the database objects in your development db through migrations. You may have specified a certain tablespace name by passing <img src='http://db2onrails.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> ptions =&gt; “IN mytablespace” to the create_table method. Running rake db:test:clone will generate the table in the test database within the default tablespace (USERSPACE1) rather than in the one that you’ve specified for the development database. Not only this, but if you manually defined foreign keys by executing sql statements in the migrations or directly, these will not appear in the cloned test database.</p>
<p>This is not an issue specific to <span class="caps">DB2</span>, it is just the way it works in Rails at the moment. In fact there are third party plugins that attempt to introduce these and other features that are shortcoming of Rails’ core (e.g. <a href="http://wiki.rubyonrails.org/rails/pages/Foreign+Key+Schema+Dumper+Plugin">Foreign Key Schema Dumper Plugin</a> for MySQL and PostgreSQL).</p>
<p>In order to address those two concerns when using <span class="caps">DB2</span>, you don’t have to operate on the definition of the task directly. In fact, the db:test:clone loads the dumped schema in the test environment. The culprit is therefore ActiveRecord SchemaDumper which doesn’t know anything about <span class="caps">DB2</span> Tablespaces and about foreign keys. Changes to this will also affect the db:schema:dump task, which will in turn produce more correct and “database aware” db\schema.rb files.</p>
<p>The file schema_dumper.rb within the ActiveRecord gem (activerecord-1.15.3\lib\active_record\schema_dumper.rb) can be directly modified for your specific needs. At line 21 the dump method becomes:</p>
<p class="typocode">
<pre><code class="typocode_ruby">    <span class="keyword">def </span><span class="method">dump</span><span class="punct">(</span><span class="ident">stream</span><span class="punct">)</span>
      <span class="ident">header</span><span class="punct">(</span><span class="ident">stream</span><span class="punct">)</span>
      <span class="ident">tables</span><span class="punct">(</span><span class="ident">stream</span><span class="punct">)</span>
      <span class="comment"># Foreign keys are added for DB2 only</span>
      <span class="keyword">if</span> <span class="attribute">@connection</span><span class="punct">.</span><span class="ident">adapter_name</span> <span class="punct">==</span> <span class="punct">"</span><span class="string">IBM_DB</span><span class="punct">"</span>
        <span class="ident">foreign_keys</span><span class="punct">(</span><span class="ident">stream</span><span class="punct">)</span>
      <span class="keyword">end</span>
      <span class="ident">trailer</span><span class="punct">(</span><span class="ident">stream</span><span class="punct">)</span>
      <span class="ident">stream</span>
    <span class="keyword">end</span></code></pre>
<p>At line 89 within the table method, we need to specify code to handle the possibility of a non-default tablespace:</p>
<p class="typocode">
<pre><code class="typocode_ruby"><span class="comment"># Options to retrieve the right tablespace are enabled for DB2 only</span>
<span class="keyword">if</span> <span class="attribute">@connection</span><span class="punct">.</span><span class="ident">adapter_name</span> <span class="punct">==</span> <span class="punct">"</span><span class="string">IBM_DB</span><span class="punct">"</span>
  <span class="ident">tbspace_sql</span> <span class="punct">=</span> <span class="punct">"</span><span class="string">select TBSPACE from syscat.tables where tabname='<span class="expr">#{table.upcase}</span>'</span><span class="punct">"</span>
  <span class="ident">table_space</span> <span class="punct">=</span> <span class="attribute">@connection</span><span class="punct">.</span><span class="ident">select_one</span><span class="punct">(</span><span class="ident">tbspace_sql</span><span class="punct">)["</span><span class="string">tbspace</span><span class="punct">"]</span>
  <span class="keyword">if</span> <span class="ident">table_space</span> <span class="punct">!=</span> <span class="punct">"</span><span class="string">USERSPACE1</span><span class="punct">"</span>
    <span class="comment"># A different tablespace was defined       </span>
    <span class="ident">tbl</span><span class="punct">.</span><span class="ident">print</span> <span class="punct">%Q(</span><span class="string">, <img src='http://db2onrails.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> ptions =&gt; "IN <span class="expr">#{table_space}</span>"</span><span class="punct">)</span>
  <span class="keyword">end</span>
<span class="keyword">end</span></code></pre>
<p>At this point, just after the index method, we need to define the method foreign_keys:</p>
<p class="typocode">
<pre><code class="typocode_ruby"><span class="keyword">def </span><span class="method">foreign_keys</span><span class="punct">(</span><span class="ident">stream</span><span class="punct">)</span>
  <span class="ident">references</span> <span class="punct">=</span> <span class="attribute">@connection</span><span class="punct">.</span><span class="ident">select_all</span><span class="punct">("</span><span class="string">SELECT * FROM SYSCAT.REFERENCES</span><span class="punct">")</span>
  <span class="keyword">for</span> <span class="ident">reference</span> <span class="keyword">in</span> <span class="ident">references</span>
    <span class="ident">constraint</span> <span class="punct">=</span> <span class="ident">reference</span><span class="punct">["</span><span class="string">constname</span><span class="punct">"]</span>
    <span class="ident">schema</span> <span class="punct">=</span> <span class="ident">reference</span><span class="punct">["</span><span class="string">tabschema</span><span class="punct">"]</span>
    <span class="ident">table</span> <span class="punct">=</span> <span class="ident">reference</span><span class="punct">["</span><span class="string">tabname</span><span class="punct">"]</span>
    <span class="ident">cols</span> <span class="punct">=</span> <span class="ident">reference</span><span class="punct">["</span><span class="string">fk_colnames</span><span class="punct">"]</span>
    <span class="ident">ref_schema</span> <span class="punct">=</span> <span class="ident">reference</span><span class="punct">["</span><span class="string">reftabschema</span><span class="punct">"]</span>
    <span class="ident">ref_table</span> <span class="punct">=</span> <span class="ident">reference</span><span class="punct">["</span><span class="string">reftabname</span><span class="punct">"]</span>
    <span class="ident">ref_cols</span> <span class="punct">=</span> <span class="ident">reference</span><span class="punct">["</span><span class="string">pk_colnames</span><span class="punct">"]</span>
    <span class="keyword">if</span> <span class="ident">reference</span><span class="punct">["</span><span class="string">updaterule</span><span class="punct">"]</span> <span class="punct">==</span> <span class="punct">"</span><span class="string">R</span><span class="punct">"</span>
      <span class="ident">update_action</span> <span class="punct">=</span> <span class="punct">"</span><span class="string">RESTRICT</span><span class="punct">"</span>
    <span class="keyword">else</span>
      <span class="ident">update_action</span> <span class="punct">=</span> <span class="punct">"</span><span class="string">NO ACTION</span><span class="punct">"</span>
    <span class="keyword">end</span>

    <span class="ident">delete_action</span> <span class="punct">=</span> <span class="keyword">case</span> <span class="ident">reference</span><span class="punct">["</span><span class="string">deleterule</span><span class="punct">"]</span>
                          <span class="keyword">when</span> <span class="punct">"</span><span class="string">A</span><span class="punct">"</span>
                            <span class="punct">"</span><span class="string">NO ACTION</span><span class="punct">"</span>
                          <span class="keyword">when</span> <span class="punct">"</span><span class="string">R</span><span class="punct">"</span>
                            <span class="punct">"</span><span class="string">RESTRICT</span><span class="punct">"</span>
                          <span class="keyword">when</span> <span class="punct">"</span><span class="string">C</span><span class="punct">"</span>
                            <span class="punct">"</span><span class="string">CASCADE</span><span class="punct">"</span>
                          <span class="keyword">when</span> <span class="punct">"</span><span class="string">N</span><span class="punct">"</span>
                            <span class="punct">"</span><span class="string">SET NULL</span><span class="punct">"</span>
                          <span class="keyword">end</span>

    <span class="ident">foreign_key_sql</span> <span class="punct">=</span> <span class="punct">"</span><span class="string">  execute(<span class="escape">"</span>ALTER TABLE <span class="expr">#{schema}</span>.<span class="expr">#{table}</span> add <span class="escape">
</span>CONSTRAINT <span class="expr">#{constraint}</span> FOREIGN KEY (<span class="expr">#{cols.strip}</span>)<span class="escape">n</span>  <span class="escape">
</span>REFERENCES <span class="expr">#{ref_schema}</span>.<span class="expr">#{ref_table}</span> (<span class="expr">#{ref_cols.strip}</span>) <span class="escape">
</span>ON UPDATE <span class="expr">#{update_action}</span> ON DELETE <span class="expr">#{delete_action}</span><span class="escape">n</span>  <span class="escape">
</span>ENFORCED ENABLE QUERY OPTIMIZATION<span class="escape">"</span>)<span class="escape">n</span>  </span><span class="punct">"</span>
    <span class="ident">stream</span><span class="punct">.</span><span class="ident">print</span> <span class="ident">foreign_key_sql</span>
    <span class="ident">stream</span><span class="punct">.</span><span class="ident">puts</span>
  <span class="keyword">end</span>
<span class="keyword">end</span></code></pre>
<p>As you can imagine, it is possible to prevent the need to modify the file directly, by simply extending the SchemaDumper class in, for example, a plugin. You would have to overwrite the original methods within the SchemaDumper class:</p>
<p class="typocode">
<pre><code class="typocode_ruby"><span class="keyword">module </span><span class="module">ActiveRecord</span>
  <span class="keyword">class </span><span class="class">SchemaDumper</span>

    <span class="comment"># ...</span>

    <span class="keyword">def </span><span class="method">dump</span><span class="punct">(</span><span class="ident">stream</span><span class="punct">)</span>
      <span class="comment">#...</span>
    <span class="keyword">end</span>

    <span class="ident">private</span>

    <span class="comment"># ...</span>

    <span class="keyword">def </span><span class="method">table</span><span class="punct">(</span><span class="ident">table</span><span class="punct">,</span> <span class="ident">stream</span><span class="punct">)</span>
      <span class="comment"># ...</span>
    <span class="keyword">end</span>

    <span class="comment"># ...</span>

    <span class="keyword">def </span><span class="method">foreign_keys</span><span class="punct">(</span><span class="ident">stream</span><span class="punct">)</span>
    <span class="comment"># ...</span>
    <span class="keyword">end</span>

  <span class="keyword">end</span>
<span class="keyword">end</span></code></pre>
<p>It would be beneficial to aggregate several improvements in a “DB2 PowerPack” plugin of some sort, and it’s very likely that we will eventually work on publishing something like this.</p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fdb2onrails.com%2F2007%2F06%2F20%2Frake-db-test-purge-and-rake-db-test-clone%2F&amp;title=rake+db%3Atest%3Apurge+and+rake+db%3Atest%3Aclone" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fdb2onrails.com%2F2007%2F06%2F20%2Frake-db-test-purge-and-rake-db-test-clone%2F&amp;title=rake+db%3Atest%3Apurge+and+rake+db%3Atest%3Aclone" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fdb2onrails.com%2F2007%2F06%2F20%2Frake-db-test-purge-and-rake-db-test-clone%2F&amp;title=rake+db%3Atest%3Apurge+and+rake+db%3Atest%3Aclone" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fdb2onrails.com%2F2007%2F06%2F20%2Frake-db-test-purge-and-rake-db-test-clone%2F&amp;title=rake+db%3Atest%3Apurge+and+rake+db%3Atest%3Aclone" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fdb2onrails.com%2F2007%2F06%2F20%2Frake-db-test-purge-and-rake-db-test-clone%2F&amp;title=rake+db%3Atest%3Apurge+and+rake+db%3Atest%3Aclone', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fdb2onrails.com%2F2007%2F06%2F20%2Frake-db-test-purge-and-rake-db-test-clone%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fdb2onrails.com%2F2007%2F06%2F20%2Frake-db-test-purge-and-rake-db-test-clone%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fdb2onrails.com%2F2007%2F06%2F20%2Frake-db-test-purge-and-rake-db-test-clone%2F&amp;title=rake+db%3Atest%3Apurge+and+rake+db%3Atest%3Aclone" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fdb2onrails.com%2F2007%2F06%2F20%2Frake-db-test-purge-and-rake-db-test-clone%2F&amp;title=rake+db%3Atest%3Apurge+and+rake+db%3Atest%3Aclone" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>]]></content:encoded>
			<wfw:commentRss>http://db2onrails.com/2007/06/20/rake-db-test-purge-and-rake-db-test-clone/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A couple of webcasts on DB2 Express-C</title>
		<link>http://db2onrails.com/2007/05/30/a-couple-of-webcasts-on-db2-express-c/</link>
		<comments>http://db2onrails.com/2007/05/30/a-couple-of-webcasts-on-db2-express-c/#comments</comments>
		<pubDate>Thu, 31 May 2007 01:59:00 +0000</pubDate>
		<dc:creator>Leon Katsnelson</dc:creator>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[How-to]]></category>

		<guid isPermaLink="false">http://db2onrails.com/2007/05/30/a-couple-of-webcasts-on-db2-express-c/</guid>
		<description><![CDATA[One of the key components of the Starter Toolkit for DB2 on Rails is the free DB2 Express-C data server. Recently we announced that not only do we offer a free DB2 Express-C but that you now also have an option of purchasing support subscription if you need one. With this support subscription you also [...]]]></description>
			<content:encoded><![CDATA[<p>One of the key components of the Starter Toolkit for <span class="caps">DB2</span> on Rails is the free <span class="caps">DB2</span> Express-C data server. Recently we announced that not only do we offer a free <a href="http://www.ibm.com/db2/express/"><span class="caps">DB2</span> Express-C</a> but that you now also have an option of purchasing support subscription if you need one. With this support subscription you also get data replication and high availability clustering and remote site disaster recovery. Pretty decent set of features for $2995 for a server for one year.<br />
On June 7 we will talk about this product in a couple of free (naturally) webcasts. One of the webcasts called <a href="https://www14.software.ibm.com/webapp/iwm/web/preLogin.do?lang=en_US&amp;source=dw-c-wcsdp&amp;S_PKG=060707&amp;S_TACT=105AGX63&amp;S_CMP=WCDTA">Premiering <span class="caps">DB2</span> Express-C: The truly free database</a> is designed to introduce developers to <span class="caps">DB2</span> Express-C. The other webcast <a href="https://isvwebcast.on.raindance.com/confmgr/event_description.jsp?title=Drive+revenue+with+DB2+Express-C&amp;type=regrequired&amp;eventid=41863">Drive revenue with <span class="caps">DB2</span> Express-C</a> is more suited for ISVs and business partners. If you don’t catch either one of the webcasts on June 7, don’t worry, they will be available for a replay. To register for these webcast or for a later replay click on the links above.</p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fdb2onrails.com%2F2007%2F05%2F30%2Fa-couple-of-webcasts-on-db2-express-c%2F&amp;title=A+couple+of+webcasts+on+DB2+Express-C" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fdb2onrails.com%2F2007%2F05%2F30%2Fa-couple-of-webcasts-on-db2-express-c%2F&amp;title=A+couple+of+webcasts+on+DB2+Express-C" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fdb2onrails.com%2F2007%2F05%2F30%2Fa-couple-of-webcasts-on-db2-express-c%2F&amp;title=A+couple+of+webcasts+on+DB2+Express-C" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fdb2onrails.com%2F2007%2F05%2F30%2Fa-couple-of-webcasts-on-db2-express-c%2F&amp;title=A+couple+of+webcasts+on+DB2+Express-C" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fdb2onrails.com%2F2007%2F05%2F30%2Fa-couple-of-webcasts-on-db2-express-c%2F&amp;title=A+couple+of+webcasts+on+DB2+Express-C', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fdb2onrails.com%2F2007%2F05%2F30%2Fa-couple-of-webcasts-on-db2-express-c%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fdb2onrails.com%2F2007%2F05%2F30%2Fa-couple-of-webcasts-on-db2-express-c%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fdb2onrails.com%2F2007%2F05%2F30%2Fa-couple-of-webcasts-on-db2-express-c%2F&amp;title=A+couple+of+webcasts+on+DB2+Express-C" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fdb2onrails.com%2F2007%2F05%2F30%2Fa-couple-of-webcasts-on-db2-express-c%2F&amp;title=A+couple+of+webcasts+on+DB2+Express-C" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>]]></content:encoded>
			<wfw:commentRss>http://db2onrails.com/2007/05/30/a-couple-of-webcasts-on-db2-express-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DB2 and Ruby on Rails, Part 1</title>
		<link>http://db2onrails.com/2007/05/28/db2-and-ruby-on-rails-part-1/</link>
		<comments>http://db2onrails.com/2007/05/28/db2-and-ruby-on-rails-part-1/#comments</comments>
		<pubDate>Mon, 28 May 2007 15:10:00 +0000</pubDate>
		<dc:creator>Antonio Cangiano</dc:creator>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[How-to]]></category>

		<guid isPermaLink="false">http://db2onrails.com/2007/05/28/db2-and-ruby-on-rails-part-1/</guid>
		<description><![CDATA[Developerworks has published the first part of a long and detailed article about DB2 on Rails programming. In this article the basics of how to get started, migrations and an introduction to working with XML are covered. In the follow up article, XML will be covered in detail with informative step-by-step instructions on how to [...]]]></description>
			<content:encoded><![CDATA[<p>Developerworks has published the first part of a long and detailed article about <span class="caps">DB2</span> on Rails programming. In this article the basics of how to get started, migrations and an introduction to working with <span class="caps">XML</span> are covered. In the follow up article, <span class="caps">XML</span> will be covered in detail with informative step-by-step instructions on how to use <span class="caps">DB2</span> pureXML™ in Rails. I’m sure you will find them to be extemely useful and informative.</p>
<p>Please visit and rate the first part of the article <a href="http://www.ibm.com/developerworks/db2/library/techarticle/dm-0705chun/">here</a>.</p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fdb2onrails.com%2F2007%2F05%2F28%2Fdb2-and-ruby-on-rails-part-1%2F&amp;title=DB2+and+Ruby+on+Rails%2C+Part+1" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fdb2onrails.com%2F2007%2F05%2F28%2Fdb2-and-ruby-on-rails-part-1%2F&amp;title=DB2+and+Ruby+on+Rails%2C+Part+1" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fdb2onrails.com%2F2007%2F05%2F28%2Fdb2-and-ruby-on-rails-part-1%2F&amp;title=DB2+and+Ruby+on+Rails%2C+Part+1" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fdb2onrails.com%2F2007%2F05%2F28%2Fdb2-and-ruby-on-rails-part-1%2F&amp;title=DB2+and+Ruby+on+Rails%2C+Part+1" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fdb2onrails.com%2F2007%2F05%2F28%2Fdb2-and-ruby-on-rails-part-1%2F&amp;title=DB2+and+Ruby+on+Rails%2C+Part+1', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fdb2onrails.com%2F2007%2F05%2F28%2Fdb2-and-ruby-on-rails-part-1%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fdb2onrails.com%2F2007%2F05%2F28%2Fdb2-and-ruby-on-rails-part-1%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fdb2onrails.com%2F2007%2F05%2F28%2Fdb2-and-ruby-on-rails-part-1%2F&amp;title=DB2+and+Ruby+on+Rails%2C+Part+1" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fdb2onrails.com%2F2007%2F05%2F28%2Fdb2-and-ruby-on-rails-part-1%2F&amp;title=DB2+and+Ruby+on+Rails%2C+Part+1" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>]]></content:encoded>
			<wfw:commentRss>http://db2onrails.com/2007/05/28/db2-and-ruby-on-rails-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
