I need to write a standalone ruby script that is supposed to deal with database. I used code given below in rails 3
@connection = ActiveRecord::Base.establis
connection = ActiveRecord::Base.connection connection.execute("SQL query")