ActiveRecord-JDBC 0.2

The JRuby-extras project is proud to announce the release of version 0.2 of ActiveRecord-JDBC.

This release brings much needed functionality and usability. Since 0.0.1, the project have gone from proof-of-concept to something that's actually usable.

ActiveRecord-JDBC now supports migrations and connections with 8 databases: MySQL, PostgreSQL, Oracle, MS SQL Server, DB2, Derby, FireBird and HSQLDB. Most of the standard functionality in ActiveRecord works with these databases, and Migrations are also there except for those cases when the database cannot support the operation.

The release can be installed as a gem with:

jruby gem install ActiveRecord-JDBC --no-rdoc --no-ri

JRuby-extras: http://rubyforge.org/projects/jruby-extras/

Very cool.

Question - for those of us on Unix based OSs like MacOS X, what is the best way to connect to SQL Server for Rails apps?

I've got a system setup to use ODBC but this seems like a simpler alternative.

Any idea of performance differences between the solutions?

H

If you're on a platform that doesn't support ODBC very well (basically anything non-Windows) the Rails + ActiveRecord-JDBC + SQL Server JDBC driver should always work without much fuss. It's the same code everywhere, so it will work on any platform where Java's supported.

We haven't done much benchmarking, but it breaks down like this: JRuby is still about twice as slow as Ruby for pure interpreted code (sometimes more in odd cases), but database access over JDBC should be as fast or faster than anything C-based (as the existing Rails adapters are). Database IO speed is a strong point for Java, so it helps to offset remaining performance issues in JRuby.

HH wrote:

Very cool.

Question - for those of us on Unix based OSs like MacOS X, what is the best way to connect to SQL Server for Rails apps?

I've got a system setup to use ODBC but this seems like a simpler alternative.

Any idea of performance differences between the solutions?

H

Well, either you could use an ODBC solution (that's the way AWDwR shows how to do it) or you use JRuby. Those are really your only options.

Yeah, as I stated in the message, we have ODBC setup and it works. The setup is a pain and the tools aren't great so I thought I would ask if this was a better solution. Sounds like there's still some overhead but it is great to have options.

How would one go about converting to jdbc in rails? What would the database.yml need to look like once the gem has been installed?

Ola and I have pretty good walkthroughs on our blogs: