tags:

views:

104

answers:

2

Can I use Hibernate, for example? Active Record? I have to use jdbc for an older database so I have to use jRuby with Ruby on Rails. Thank you.

A: 

Using ActiveRecord should be possible, see instructions here.

You can also use Hibernate directly by using JRuby's Java interface, or maybe with some Ruby sugar.

molf
+1  A: 

I am using JDBC and Active Record on JRuby in parallel. In my Rails application I have done it like this:

  • the activerecord-jdbc module to connect to the database. This is my default

database.yml
development:
adapter: jdbc
driver:
url:
username: user
password: pass
(test and production accordingly)

  • some stuff is accessed via JDBC, the connection is retrieved through this:

ActiveRecord::Base.connection.instance_variable_get(:@connection)

boxofrats
thank you..everyone.
johnny