Parent

Files

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/arjdbc/jdbc/connection.rb, line 15
def initialize(config)
  self.config = config
  @connection = nil
  @jndi_connection = false
  configure_connection # ConfigHelper#configure_connection
  connection # force the connection to load (@see RubyJDbcConnection.connection)
  set_native_database_types
  @stmts = {} # AR compatibility - statement cache not used
rescue ::ActiveRecord::ActiveRecordError
  raise
rescue Java::JavaSql::SQLException => e
  e = e.cause if defined?(NativeException) && e.is_a?(NativeException) # JRuby-1.6.8
  error = e.getMessage || e.getSQLState
  error = error ? "#{e.java_class.name}: #{error}" : e.java_class.name
  error = ::ActiveRecord::JDBCError.new("The driver encountered an unknown error: #{error}")
  error.errno = e.getErrorCode
  error.sql_exception = e
  raise error
end

Public Instance Methods

active?() click to toggle source
# File lib/arjdbc/jdbc/connection.rb, line 39
def active?
  !! @connection
end
adapter=(adapter) click to toggle source
# File lib/arjdbc/jdbc/connection.rb, line 43
def adapter=(adapter)
  @adapter = adapter
  @native_database_types = dup_native_types
  @adapter.modify_types(@native_database_types)
  @adapter.config.replace(config)
end
jndi_connection?() click to toggle source
# File lib/arjdbc/jdbc/connection.rb, line 35
def jndi_connection?
  @jndi_connection == true
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.