Module: ArJdbc::Abstract::Core
- Included in:
- ActiveRecord::ConnectionAdapters::JdbcAdapter, ActiveRecord::ConnectionAdapters::MSSQLAdapter, ActiveRecord::ConnectionAdapters::PostgreSQLAdapter, ActiveRecord::ConnectionAdapters::SQLite3Adapter
- Defined in:
- lib/arjdbc/abstract/core.rb
Overview
This is minimum amount of code needed from base JDBC Adapter class to make common adapters work. This replaces using jdbc/adapter as a base class for all adapters.
Instance Method Summary collapse
- #initialize ⇒ Object
-
#jdbc_connection(unwrap = nil) ⇒ Java::JavaSql::Connection
Retrieve the raw
java.sql.Connectionobject.
Instance Method Details
#initialize ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/arjdbc/abstract/core.rb', line 8 def initialize(...) super if self.class.equal? ActiveRecord::ConnectionAdapters::JdbcAdapter spec = @config.key?(:adapter_spec) ? @config[:adapter_spec] : ( @config[:adapter_spec] = adapter_spec(@config) ) # due resolving visitor extend spec if spec end end |
#jdbc_connection(unwrap = nil) ⇒ Java::JavaSql::Connection
Retrieve the raw java.sql.Connection object.
The unwrap parameter is useful if an attempt to unwrap a pooled (JNDI)
connection should be made - to really return the 'native' JDBC object.
23 24 25 |
# File 'lib/arjdbc/abstract/core.rb', line 23 def jdbc_connection(unwrap = nil) raw_connection.jdbc_connection(unwrap) end |