title: How do I use Ruby on Rails 3.1 with DataMapper on JRuby with a DB2/400 database?
body: <p>I am developing a <a href="http://RubyOnRails.Org/" rel="nofollow noreferrer">Rails 3.1</a> application on top of a legacy DB2/400 database. Because of the better support for legacy schemas, I opted to use <a href="http://DataMapper.Org/" rel="nofollow noreferrer">DataMapper</a> instead of <a href="http://AR.RubyOnRails.Org/" rel="nofollow noreferrer">ActiveRecord</a> as the ORM. The application is going to be deployed on <a href="http://JRuby.Org/" rel="nofollow noreferrer">JRuby</a>.</p>
  
  <p>What is the best way to access a DB2 database in this case?</p>
  
  <p>My initial research indicated that this would be trivial, since one of the major selling points of using JRuby on Rails is that you get JDBC, and thus access to pretty much any database on the planet.</p>
  
  <p>However, it appears that is not necessarily true, in particular, there doesn't seem to be any driver for either ActiveRecord or DataMapper/DataObjects for using DB2 over JDBC.</p>
  
  <p>Do I have to write my own driver? From reading the <a href="https://GitHub.Com/DataMapper/DO/blob/master/do_hsqldb/ext-java/src/main/java/do_hsqldb/HsqldbDriverDefinition.java" rel="nofollow noreferrer">source code of the various existing DataObjects/DataMapper JDBC drivers</a>, this shouldn't be <em>too</em> hard, but it is something I'd rather like to avoid.</p>
  
  <p>Is there any ready-made solution (library, gem, blog post, tutorial) for using DB2/400 with JRuby on Rails with DataMapper? If not, how do I do it?</p>