Permalink
Browse files

modifications to Oracle connection.rb setup

  • Loading branch information...
1 parent 9b2309c commit 44a7ef85eba5491aaef5a890ef2b44b111888d35 @rsim rsim committed Jun 5, 2009
Showing with 17 additions and 3 deletions.
  1. +17 −3 activerecord/test/connections/native_oracle/connection.rb
@@ -1,8 +1,13 @@
# gem "rsim-activerecord-oracle_enhanced-adapter"
-gem "activerecord-oracle_enhanced-adapter", ">=1.2.0"
+# gem "activerecord-oracle_enhanced-adapter", ">=1.2.1"
# uses local copy of oracle_enhanced adapter
-# $:.unshift("../../oracle-enhanced/lib")
-# require 'active_record/connection_adapters/oracle_enhanced_adapter'
+$:.unshift("../../oracle-enhanced/lib")
+require 'active_record/connection_adapters/oracle_enhanced_adapter'
+# gem "activerecord-jdbc-adapter"
+# require 'active_record/connection_adapters/jdbc_adapter'
+
+# otherwise failed with silence_warnings method missing exception
+require 'active_support/core_ext/kernel/reporting'
print "Using Oracle\n"
require_dependency 'models/course'
@@ -20,6 +25,9 @@
:adapter => 'oracle_enhanced',
:database => db,
:host => "localhost", # used just by JRuby to construct JDBC connect string
+ # :adapter => "jdbc",
+ # :driver => "oracle.jdbc.driver.OracleDriver",
+ # :url => "jdbc:oracle:thin:@localhost:1521:#{db}",
:username => 'arunit',
:password => 'arunit',
:emulate_oracle_adapter => true
@@ -28,6 +36,9 @@
:adapter => 'oracle_enhanced',
:database => db,
:host => "localhost", # used just by JRuby to construct JDBC connect string
+ # :adapter => "jdbc",
+ # :driver => "oracle.jdbc.driver.OracleDriver",
+ # :url => "jdbc:oracle:thin:@localhost:1521:#{db}",
:username => 'arunit2',
:password => 'arunit2',
:emulate_oracle_adapter => true
@@ -37,6 +48,9 @@
ActiveRecord::Base.establish_connection 'arunit'
Course.establish_connection 'arunit2'
+# ActiveRecord::Base.connection.execute %q{alter session set nls_date_format = 'YYYY-MM-DD HH24:MI:SS'}
+# ActiveRecord::Base.connection.execute %q{alter session set nls_timestamp_format = 'YYYY-MM-DD HH24:MI:SS'} rescue nil
+
# for assert_queries test helper
ActiveRecord::Base.connection.class.class_eval do
IGNORED_SELECT_SQL = [/^select .*nextval/i, /^SAVEPOINT/, /^ROLLBACK TO SAVEPOINT/, /^RELEASE SAVEPOINT/, /^\s*select .* from all_tab_columns/im]

0 comments on commit 44a7ef8

Please sign in to comment.