Class: ActiveRecord::ConnectionAdapters::JdbcConnection

Inherits:
Object
  • Object
show all
Includes:
ConfigHelper
Defined in:
lib/arjdbc/jdbc/connection.rb

Direct Known Subclasses

PostgresJdbcConnection

Defined Under Namespace

Modules: ConfigHelper

Instance Attribute Summary collapse

Attributes included from ConfigHelper

#config

Instance Method Summary collapse

Methods included from ConfigHelper

#configure_connection, #configure_jdbc, #configure_jndi, #configure_url

Constructor Details

#initialize(config) ⇒ JdbcConnection

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



82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/arjdbc/jdbc/connection.rb', line 82

def initialize(config)
  self.config = config
  configure_connection
  connection # force the connection to load
  set_native_database_types
  @stmts = {}
rescue ::ActiveRecord::ActiveRecordError
  raise
rescue Exception => e
  raise ::ActiveRecord::JDBCError.new("The driver encountered an unknown error: #{e}").tap { |err|
    err.errno = 0
    err.sql_exception = e
  }
end

Instance Attribute Details

#adapterObject

Returns the value of attribute adapter.



72
73
74
# File 'lib/arjdbc/jdbc/connection.rb', line 72

def adapter
  @adapter
end

#connection_factoryObject (readonly)

Returns the value of attribute connection_factory.



72
73
74
# File 'lib/arjdbc/jdbc/connection.rb', line 72

def connection_factory
  @connection_factory
end

Instance Method Details

#active?Boolean

Returns:

  • (Boolean)


126
127
128
# File 'lib/arjdbc/jdbc/connection.rb', line 126

def active?
  @connection
end

#jndi_connection?Boolean

Returns:

  • (Boolean)


122
123
124
# File 'lib/arjdbc/jdbc/connection.rb', line 122

def jndi_connection?
  @jndi_connection
end