Class: Connectator::DB2::Connection

Inherits:
Base::Connection show all
Includes:
UsingDBIProxy
Defined in:
lib/connectator/db2/connection.rb

Instance Attribute Summary

Attributes inherited from Base::Connection

#error

Instance Method Summary collapse

Methods inherited from Base::Connection

#connection_params, #method_missing, #ping?, #valid?, #valid_system_connection?

Constructor Details

#initialize(opts = {}) ⇒ Connection

Returns a new instance of Connection.



6
7
8
9
10
11
# File 'lib/connectator/db2/connection.rb', line 6

def initialize(opts = {})
  super(opts)
  connection_params.driver   = 'DB2' 
  connection_params.protocol = 'TCPIP'
  connection_params.database = opts[:database]
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Connectator::Base::Connection

Instance Method Details

#connection_stringObject



13
14
15
# File 'lib/connectator/db2/connection.rb', line 13

def connection_string
  "DBI:ODBC:#{connection_params_list}"
end