Method: LogStash::PluginMixins::JdbcStreaming#prepare_jdbc_connection

Defined in:
lib/logstash/plugin_mixins/jdbc_streaming.rb

#prepare_jdbc_connectionObject



59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/logstash/plugin_mixins/jdbc_streaming.rb', line 59

def prepare_jdbc_connection
  load_driver

  @database = Sequel.connect(@jdbc_connection_string, complete_sequel_opts)
  if @jdbc_validate_connection
    @database.extension(:connection_validator)
    @database.pool.connection_validation_timeout = @jdbc_validation_timeout
  end
  begin
    @database.test_connection
  rescue Sequel::DatabaseConnectionError => e
    #TODO return false and let the plugin raise a LogStash::ConfigurationError
    raise e
  end
end