I have installed:

  1. JRuby (1.7.0.preview2)
  2. Rails (3.2.8)
  3. IBM DB2 Express C (1.01)
  4. active-record-jdbc-adapter (1.2.2)

How should I change the database.yml file in order to my rails application to connect to DB2 database?

I have followed this article:

https://github.com/jruby/activerecord-jdbc-adapter

but there is no example with DB2 database. Also, why it is said that I should change Jruby to use always JDBC adapter.

If you’re using Rails 3, you’ll need to modify your Gemfile to use the activerecord-jdbc-adapter gem under JRuby. Change your Gemfile to look like the following (using sqlite3 as an example):

if defined?(JRUBY_VERSION)
  gem 'activerecord-jdbc-adapter'
  gem 'jdbc-sqlite3'
else
  gem 'sqlite3-ruby', :require => 'sqlite3'
end

and where should I put the statement above?

share|improve this question

79% accept rate
feedback

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
or
required, but never shown
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.