This is a reply to several questions from the last few days on database connectivity.

Firstly, ActiveRecord is quite handy for dealing with databases, as long as they don't have multi-column keys and other interesting non-Railsy things like that. Find out how here:

http://wiki.rubyonrails.com/rails/show/HowToUseActiveRecordOutsideRails

Active Record is available via rubygems: "gem install activerecord". If you need to use ADO (i.e. for a MS SQL Server database), you will also need ADO.rb. You can get it here:

http://www.dave.burt.id.au/ruby/dbd-ado.zip

Now, that is a DBD (DataBase Driver) for the DBI library (common DataBase Interface), which you can use directly - drivers exist for most popular databases. This is how I would recommend accessing a database from Ruby for testing purposes. You can read about DBI here:

http://www.kitebird.com/articles/ruby-dbi.html

Now, Java! You can easily interface with Java using JRuby. JRuby isn't a library, it's a separate Ruby interpreter that runs under Java:

http://jruby.sourceforge.net/

Then you can do cool stuff like this:
http://redhanded.hobix.com/bits/funkedOutJavaRubyAggregator.html

Write back if any of this is unclear.

Cheers,
Dave
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to