Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## MySQL
- # require AR
- require 'rubygems'
- require 'active_record'
- # connect to the database
- ActiveRecord::Base.establish_connection(
- :adapter => "mysql",
- :host => "localhost",
- :database => "echi_records",
- :username => "root",
- :password => "",
- :port => 3306
- )
- # define a simple model
- class EchiRecord < ActiveRecord::Base
- #set_table_name "PCO_ECHIRECORD" #COMMENT ME OUT TO TEST WITH ORACLE/PRESENCE
- end
- record = EchiRecord.find(:first)
- puts record.inspect
- ## Oracle
- # require AR
- require 'rubygems'
- require 'active_record'
- # connect to the database
- ActiveRecord::Base.establish_connection(
- :adapter => "oci",
- :host => "localhost",
- #:database => "echi_records",
- :username => "root",
- :password => "",
- #:port => 3306
- )
- # define a simple model
- class EchiRecord < ActiveRecord::Base
- set_table_name "PCO_ECHIRECORD" #COMMENT ME OUT TO TEST WITH ORACLE/PRESENCE
- end
- record = EchiRecord.find(:first)
- puts record.inspect
Add Comment
Please, Sign In to add comment