Friday, August 28, 2009

connecting mysql in jruby

Pre-requisite: jruby, activerecord, jdbcmysql

#jruby_mysql.rb
require 'rubygems'
require 'active_record'

ActiveRecord::Base.establish_connection(
:adapter=> "jdbcmysql",
:host => "localhost",
:database=> "students",
:username => "root",
:password => ""
)

0 comments:

Post a Comment