Method: Sequel::JDBC::Database#initialize

Defined in:
lib/sequel/adapters/jdbc.rb

#initialize(opts) ⇒ Database

Call the DATABASE_SETUP proc directly after initialization, so the object always uses sub adapter specific code. Also, raise an error immediately if the connection doesn’t have a uri, since JDBC requires one.

Raises:



114
115
116
117
118
119
120
121
122
123
124
# File 'lib/sequel/adapters/jdbc.rb', line 114

def initialize(opts)
  super
  @convert_types = typecast_value_boolean(@opts.fetch(:convert_types, true))
  raise(Error, "No connection string specified") unless uri
  
  resolved_uri = jndi? ? get_uri_from_jndi : uri

  if match = /\Ajdbc:([^:]+)/.match(resolved_uri) and prok = DATABASE_SETUP[match[1].to_sym]
    prok.call(self)
  end        
end