Sha256: b41eba201c94ea3f69f4db0f77ac50352b258de83244967b5a47bca49dc83c2c

Contents?: true

Size: 874 Bytes

Versions: 4

Compression:

Stored size: 874 Bytes

Contents

class ActiveRecord::Base
  class << self
    def teradata_connection(config)
      begin
        require 'jdbc/teradata'
        ::Jdbc::Teradata.load_driver(:require) if defined?(::Jdbc::Teradata.load_driver)
      rescue LoadError # assuming driver.jar is on the class-path
      end

      config[:username] ||= Java::JavaLang::System.get_property('user.name')
      config[:host] ||= 'localhost'
      config[:port] ||= 1025
      config[:url] ||= "jdbc:teradata://#{config[:host]}/DATABASE=#{config[:database]},DBS_PORT=#{config[:port]},COP=OFF,tmode=ANSI,charset=UTF8"
      config[:driver] ||= 'com.teradata.jdbc.TeraDriver'
      config[:adapter_class] = ActiveRecord::ConnectionAdapters::TeradataAdapter
      config[:adapter_spec] = ::ArJdbc::Teradata
      jdbc_connection(config)
    end
    alias_method :jdbcteradata_connection, :teradata_connection
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
activerecord-jdbcteradata-adapter-0.3.9 lib/arjdbc/teradata/connection_methods.rb
activerecord-jdbcteradata-adapter-0.3.8 lib/arjdbc/teradata/connection_methods.rb
activerecord-jdbcteradata-adapter-0.3.7 lib/arjdbc/teradata/connection_methods.rb
activerecord-jdbcteradata-adapter-0.3.6 lib/arjdbc/teradata/connection_methods.rb