Parent

Class/Module Index [+]

Quicksearch

ActiveRecord::ConnectionAdapters::JdbcConnection

Attributes

adapter[R]
connection_factory[R]

Public Class Methods

new(config) click to toggle source

@native_database_types - setup properly by adapter= versus set_native_database_types.

This contains type information for the adapter.  Individual adapters can make tweaks
by defined modify_types

@native_types - This is the default type settings sans any modifications by the individual adapter. My guess is that if we loaded two adapters of different types then this is used as a base to be tweaked by each adapter to create @native_database_types

# File lib/active_record/connection_adapters/jdbc_adapter.rb, line 308
def initialize(config)
  @config = config.symbolize_keys!
  @config[:retry_count] ||= 5
  @config[:connection_alive_sql] ||= "select 1"
  if @config[:jndi]
    begin
      configure_jndi
    rescue => e
      warn "JNDI data source unavailable: #{e.message}; trying straight JDBC"
      configure_jdbc
    end
  else
    configure_jdbc
  end
  connection # force the connection to load
  set_native_database_types
  @stmts = {}
rescue Exception => e
  raise "The driver encountered an error: #{e}"
end

Public Instance Methods

adapter=(adapter) click to toggle source
# File lib/active_record/connection_adapters/jdbc_adapter.rb, line 329
def adapter=(adapter)
  @adapter = adapter
  @native_database_types = dup_native_types
  @adapter.modify_types(@native_database_types)
end
jndi_connection?() click to toggle source
# File lib/active_record/connection_adapters/jdbc_adapter.rb, line 349
def jndi_connection?
  @jndi_connection
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.