Sha256: 979e29cbc99948f9af70b341ffed0a4388836cc19302dc08ddc286e5742bc8cb

Contents?: true

Size: 754 Bytes

Versions: 6

Compression:

Stored size: 754 Bytes

Contents

ArJdbc::ConnectionMethods.module_eval do
  # Unless a connection URL (`url: jdbc:oracle:...`) is specified we'll use the
  # *thin* method to connect to the Oracle DB.
  # @note Oracle's JDBC driver should be on the class-path.
  def oracle_connection(config)
    config[:port] ||= 1521
    config[:url] ||= "jdbc:oracle:thin:@#{config[:host]}:#{config[:port]}:#{config[:database]}"
    config[:driver] ||= "oracle.jdbc.driver.OracleDriver"
    config[:adapter_spec] ||= ::ArJdbc::Oracle
    config[:adapter_class] = ActiveRecord::ConnectionAdapters::OracleAdapter unless config.key?(:adapter_class)
    config[:connection_alive_sql] ||= 'SELECT 1 FROM DUAL'
    jdbc_connection(config)
  end
  alias_method :jdbcoracle_connection, :oracle_connection
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
activerecord-jdbc-adapter-1.3.4 lib/arjdbc/oracle/connection_methods.rb
activerecord-jdbc-adapter-1.3.3 lib/arjdbc/oracle/connection_methods.rb
activerecord-jdbc-adapter-1.3.2 lib/arjdbc/oracle/connection_methods.rb
activerecord-jdbc-adapter-1.3.1 lib/arjdbc/oracle/connection_methods.rb
activerecord-jdbc-adapter-1.3.0 lib/arjdbc/oracle/connection_methods.rb
activerecord-jdbc-adapter-1.3.0.rc1 lib/arjdbc/oracle/connection_methods.rb