<?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; Tips&amp;Tricks</title>
	<atom:link href="http://db2onrails.com/category/tipstricks/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>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>Solving &#8220;LoadError: 14001&#8243; driver errors</title>
		<link>http://db2onrails.com/2007/10/23/solving-loaderror-14001-driver-errors/</link>
		<comments>http://db2onrails.com/2007/10/23/solving-loaderror-14001-driver-errors/#comments</comments>
		<pubDate>Tue, 23 Oct 2007 14:47:12 +0000</pubDate>
		<dc:creator>Antonio Cangiano</dc:creator>
				<category><![CDATA[Tips&Tricks]]></category>

		<guid isPermaLink="false">http://db2onrails.com/2007/10/23/solving-loaderror-14001-driver-errors/</guid>
		<description><![CDATA[Yesterday, there have been a couple of reports of problems with the driver immediately after upgrades to the ibm_db gem version 0.9.0 on Microsoft Windows. The error reported is analogous to the following:
gem 'ibm_db'
require 'mswin32/ibm_db'
LoadError: 14001: The application has failed to start because its side-by-side
configuration is incorrect. Please see the application event log for more [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday, there have been a couple of reports of problems with the driver immediately after upgrades to the ibm_db gem version 0.9.0 on Microsoft Windows. The error reported is analogous to the following:</p>
<pre class="db2code"><code>gem 'ibm_db'
require 'mswin32/ibm_db'
LoadError: 14001: The application has failed to start because its side-by-side
configuration is incorrect. Please see the application event log for more detail.</code></pre>
<p>Or in other cases:</p>
<pre class="db2code"><code>LoadError: 14001: This application has failed to start because the application
configurationis incorrect. Reinstalling the application may fix this problem.</code></pre>
<p>If you haven&#8217;t received this type of error message, your installation is working and stable. For those few of you who experienced this problem, I want to let you know that this issue is actively being investigated and the proposed solution is being thoroughly tested. Since the error above does not only concern our driver (other applications are raising similar errors on Windows), it appears that the problem is related to the lack or misconfiguration of the VC8 runtime. </p>
<p>Those of you who received an error message, can try to install the <a href="http://www.microsoft.com/downloads/details.aspx?familyid=32bc1bee-a3f9-4c13-9c99">Microsoft Visual C++ 2005 Redistributable Package (x86)</a> and try again. This ensures that the VC8 runtime is configured in order to support the new DB2 CLI binary dependencies related to the &#8220;native assembly cache (also called WinSxS folder)&#8221;. This solved the problem in our preliminary tests. Please use the comments to tell us if this worked for you.</p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fdb2onrails.com%2F2007%2F10%2F23%2Fsolving-loaderror-14001-driver-errors%2F&amp;title=Solving+%26%238220%3BLoadError%3A+14001%26%238243%3B+driver+errors" 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%2F23%2Fsolving-loaderror-14001-driver-errors%2F&amp;title=Solving+%26%238220%3BLoadError%3A+14001%26%238243%3B+driver+errors" 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%2F23%2Fsolving-loaderror-14001-driver-errors%2F&amp;title=Solving+%26%238220%3BLoadError%3A+14001%26%238243%3B+driver+errors" 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%2F23%2Fsolving-loaderror-14001-driver-errors%2F&amp;title=Solving+%26%238220%3BLoadError%3A+14001%26%238243%3B+driver+errors" 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%2F23%2Fsolving-loaderror-14001-driver-errors%2F&amp;title=Solving+%26%238220%3BLoadError%3A+14001%26%238243%3B+driver+errors', '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%2F23%2Fsolving-loaderror-14001-driver-errors%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%2F23%2Fsolving-loaderror-14001-driver-errors%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%2F23%2Fsolving-loaderror-14001-driver-errors%2F&amp;title=Solving+%26%238220%3BLoadError%3A+14001%26%238243%3B+driver+errors" 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%2F23%2Fsolving-loaderror-14001-driver-errors%2F&amp;title=Solving+%26%238220%3BLoadError%3A+14001%26%238243%3B+driver+errors" 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/23/solving-loaderror-14001-driver-errors/feed/</wfw:commentRss>
		<slash:comments>3</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>IBM_DB2 or IBM_DB?</title>
		<link>http://db2onrails.com/2007/05/10/ibm_db2-or-ibm_db/</link>
		<comments>http://db2onrails.com/2007/05/10/ibm_db2-or-ibm_db/#comments</comments>
		<pubDate>Thu, 10 May 2007 06:30:00 +0000</pubDate>
		<dc:creator>Antonio Cangiano</dc:creator>
				<category><![CDATA[Tips&Tricks]]></category>

		<guid isPermaLink="false">http://db2onrails.com/2007/05/10/ibm_db2-or-ibm_db/</guid>
		<description><![CDATA[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 [...]]]></description>
			<content:encoded><![CDATA[<p>If you haven’t followed the <span class="caps">IBM</span> releases of <span class="caps">DB2</span> on Rails very closely, you may be puzzled to find a Rubyforge project alongside the <a href="http://www.alphaworks.ibm.com/tech/db2onrails">Alphaworks project</a>. I’d like to shortly clarify what’s going on. The Stater Toolkit for <span class="caps">DB2</span> 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 <span class="caps">IBM</span>_DB2.</p>
<p><span class="caps">IBM</span>’s vision of extending the driver and adapter not only to <span class="caps">DB2</span> for <span class="caps">LUW</span> (Linux/Unix/Windows), but also for the other <span class="caps">IBM</span> databases, was clearly highlighted by the renaming of the <span class="caps">DB2</span> enablement from <span class="caps">IBM</span>_DB2 to <span class="caps">IBM</span>_DB.</p>
<p>The new driver and adapter have been released in the Open Source on Rubyforge and they will be continuously improved and supported by <span class="caps">IBM</span>. Bugs, suggestions and questions should be posted directly on the <a href="http://rubyforge.org/projects/rubyibm/">homepage of the project at Rubyforge</a>. 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?</p>
<p>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, <span class="caps">DB2 9</span> Fix Pack 2 and more. Windows users who already have several components installed, and users of other operating systems, can directly setup a <span class="caps">DB2</span> 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 <span class="caps">DB2</span> itself. If you are still uncertain about something, please feel free to use the comments to ask further questions.</p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fdb2onrails.com%2F2007%2F05%2F10%2Fibm_db2-or-ibm_db%2F&amp;title=IBM_DB2+or+IBM_DB%3F" 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%2F10%2Fibm_db2-or-ibm_db%2F&amp;title=IBM_DB2+or+IBM_DB%3F" 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%2F10%2Fibm_db2-or-ibm_db%2F&amp;title=IBM_DB2+or+IBM_DB%3F" 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%2F10%2Fibm_db2-or-ibm_db%2F&amp;title=IBM_DB2+or+IBM_DB%3F" 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%2F10%2Fibm_db2-or-ibm_db%2F&amp;title=IBM_DB2+or+IBM_DB%3F', '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%2F10%2Fibm_db2-or-ibm_db%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%2F10%2Fibm_db2-or-ibm_db%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%2F10%2Fibm_db2-or-ibm_db%2F&amp;title=IBM_DB2+or+IBM_DB%3F" 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%2F10%2Fibm_db2-or-ibm_db%2F&amp;title=IBM_DB2+or+IBM_DB%3F" 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/10/ibm_db2-or-ibm_db/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Scaffolding XML columns as text area boxes</title>
		<link>http://db2onrails.com/2007/01/06/scaffolding-xml-columns-as-text-area-boxes/</link>
		<comments>http://db2onrails.com/2007/01/06/scaffolding-xml-columns-as-text-area-boxes/#comments</comments>
		<pubDate>Sat, 06 Jan 2007 09:38:00 +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/01/06/scaffolding-xml-columns-as-text-area-boxes/</guid>
		<description><![CDATA[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 [...]]]></description>
			<content:encoded><![CDATA[<p>The Rails adapter and the Ruby driver for <span class="caps">IBM DB2</span> enable you to take full advantage of the exclusive pureXML capabilities. <span class="caps">XML</span> fields are properly handled and also recognized when using migrations. We do not bind the content of <span class="caps">XML</span> columns to a specific <span class="caps">XML</span> Ruby representation (e.g. <span class="caps">REXML</span>) 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 <span class="caps">DB2</span>.</p>
<p>The scaffolding generator ignores <span class="caps">XML</span> 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 <span class="caps">XML</span> fields in a customized way, for instance, showing only certain elements of the <span class="caps">XML</span> 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:</p>
<p class="typocode">
<pre><code class="typocode_Ruby"><font size="1">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, <img src='http://db2onrails.com/wp-includes/images/smilies/icon_mad.gif' alt=':x' class='wp-smiley' /> ml
       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</font></code></pre>
<p>As you can see, all we are doing here is adding the <span class="caps">XML</span> datatype to the list of cases which require the rendering of a text area box.</p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fdb2onrails.com%2F2007%2F01%2F06%2Fscaffolding-xml-columns-as-text-area-boxes%2F&amp;title=Scaffolding+XML+columns+as+text+area+boxes" 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%2F01%2F06%2Fscaffolding-xml-columns-as-text-area-boxes%2F&amp;title=Scaffolding+XML+columns+as+text+area+boxes" 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%2F01%2F06%2Fscaffolding-xml-columns-as-text-area-boxes%2F&amp;title=Scaffolding+XML+columns+as+text+area+boxes" 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%2F01%2F06%2Fscaffolding-xml-columns-as-text-area-boxes%2F&amp;title=Scaffolding+XML+columns+as+text+area+boxes" 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%2F01%2F06%2Fscaffolding-xml-columns-as-text-area-boxes%2F&amp;title=Scaffolding+XML+columns+as+text+area+boxes', '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%2F01%2F06%2Fscaffolding-xml-columns-as-text-area-boxes%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%2F01%2F06%2Fscaffolding-xml-columns-as-text-area-boxes%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%2F01%2F06%2Fscaffolding-xml-columns-as-text-area-boxes%2F&amp;title=Scaffolding+XML+columns+as+text+area+boxes" 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%2F01%2F06%2Fscaffolding-xml-columns-as-text-area-boxes%2F&amp;title=Scaffolding+XML+columns+as+text+area+boxes" 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/01/06/scaffolding-xml-columns-as-text-area-boxes/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Speeding up the ibm_db2 adapter</title>
		<link>http://db2onrails.com/2006/08/21/speeding-up-the-ibm_db2-adapter/</link>
		<comments>http://db2onrails.com/2006/08/21/speeding-up-the-ibm_db2-adapter/#comments</comments>
		<pubDate>Mon, 21 Aug 2006 11:30:00 +0000</pubDate>
		<dc:creator>Antonio Cangiano</dc:creator>
				<category><![CDATA[Tips&Tricks]]></category>

		<guid isPermaLink="false">http://db2onrails.com/2006/08/21/speeding-up-the-ibm_db2-adapter/</guid>
		<description><![CDATA[If you would like to speed up the current 1.1 version of the adapter included in the Starter Toolkit for DB2 on Rails, you can replace the ‘tables’ and ‘colums’ methods from within the ibm_db2_adapter.rb file, with this code here.
This change will allow you to significantly boost your performance level  when working with Rails [...]]]></description>
			<content:encoded><![CDATA[<p>If you would like to speed up the current 1.1 version of the adapter included in the Starter Toolkit for <span class="caps">DB2</span> on Rails, you can replace the ‘tables’ and ‘colums’ methods from within the ibm_db2_adapter.rb file, with this code <a href="http://antoniocangiano.com/files/tables_and_columns.html">here</a>.</p>
<p>This change will allow you to significantly boost your performance level  when working with Rails and <span class="caps">DB2</span>. As you may note, the crucial change here relies on the fact that a slow driver call is replaced with an ad hoc query to the <span class="caps">SYSCAT</span>.</p>
<p>Naturally this will be included with the  next toolkit release, which will be out soon. <img src='http://db2onrails.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fdb2onrails.com%2F2006%2F08%2F21%2Fspeeding-up-the-ibm_db2-adapter%2F&amp;title=Speeding+up+the+ibm_db2+adapter" 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%2F2006%2F08%2F21%2Fspeeding-up-the-ibm_db2-adapter%2F&amp;title=Speeding+up+the+ibm_db2+adapter" 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%2F2006%2F08%2F21%2Fspeeding-up-the-ibm_db2-adapter%2F&amp;title=Speeding+up+the+ibm_db2+adapter" 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%2F2006%2F08%2F21%2Fspeeding-up-the-ibm_db2-adapter%2F&amp;title=Speeding+up+the+ibm_db2+adapter" 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%2F2006%2F08%2F21%2Fspeeding-up-the-ibm_db2-adapter%2F&amp;title=Speeding+up+the+ibm_db2+adapter', '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%2F2006%2F08%2F21%2Fspeeding-up-the-ibm_db2-adapter%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%2F2006%2F08%2F21%2Fspeeding-up-the-ibm_db2-adapter%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%2F2006%2F08%2F21%2Fspeeding-up-the-ibm_db2-adapter%2F&amp;title=Speeding+up+the+ibm_db2+adapter" 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%2F2006%2F08%2F21%2Fspeeding-up-the-ibm_db2-adapter%2F&amp;title=Speeding+up+the+ibm_db2+adapter" 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/2006/08/21/speeding-up-the-ibm_db2-adapter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
