module Legion module Data module Connections class JDBC attr_accessor :connection def initialize Legion::Logging.debug('Connecting to MySQL with JBDC Connector') connection_string = build_connection_string @connection = Sequel.connect(connection_string, max_connetions: @args[:max_connections]) Legion::Logging.info("Legion is connected to database #{args[:database]}") end def build_connection_string set = Legion::Settings[:data][:mysql] con_string = "jdbc:mysql://#{set[:host]}/#{set[:database]}?user=#{set[:user]}&password=#{set[:password]}" con_string end end end end end