Sha256: 9daec4193b6a0b1134e602f5b72ca58aa31e862d4111b30f9dfd5750a310a284

Contents?: true

Size: 594 Bytes

Versions: 6

Compression:

Stored size: 594 Bytes

Contents

#A test script that allows one to do a quick database connection test 
#to ensure their database connectivity is configured properly
#require AR
require 'rubygems'
require 'active_record'

# connect to the Database
ActiveRecord:: Base.establish_connection(
  :adapter => "oracle",
  :database => "192.168.10.3/orapr1",
  :username => "myname",
  :password => "mypass"
)

#define a simple model
class EchiRecord < ActiveRecord::Base
  set_table_name "PCO_ECHIRECORD" # comment out if not using oracle
end

begin
  record=EchiRecord.find(:first)
  puts record.inspect
rescue => err
  puts err
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
echi-converter-0.4.4 examples/db_connect_test.rb
echi-converter-0.3.7 examples/db_connect_test.rb
echi-converter-0.3.8 examples/db_connect_test.rb
echi-converter-0.4.0 examples/db_connect_test.rb
echi-converter-0.4.1 examples/db_connect_test.rb
echi-converter-0.4.2 examples/db_connect_test.rb