Sha256: b98d6dd7197dca37dbf8cc2dabfc11445fe2f8434a8939603a021de00d828ac1
Contents?: true
Size: 1.28 KB
Versions: 26
Compression:
Stored size: 1.28 KB
Contents
require 'mysql2' require 'tiny_tds' class IFD_Connections # Open the MYSQL connection to specific schema def self.get_mysql_db_connection(schema) begin # puts ("Connecting to database..."); data_source_schema = schema.downcase return Mysql2::Client.new(host: $data_source_url, username: $data_source_username, password: $data_source_password,database:data_source_schema); rescue Exception => e raise "Cannot connect to database [username: %s; password: %s, dbUrl: %s, dbName: %s] with error %s" % [$data_source_username, $data_source_password, $data_source_url,data_source_schema, e.message] end end # Open the SQL Server connection to specific schema def self.get_sql_server_db_connection(schema) begin # puts ("Connecting to database..."); data_source_schema = schema.downcase return TinyTds::Client.new(dataserver: $data_source_url, username: $data_source_username, password: $data_source_password, database:data_source_schema); rescue Exception => e raise "Cannot connect to database [username: %s; password: %s, dbUrl: %s, dbName: %s] with error %s" % [$data_source_username, $data_source_password, $data_source_url,data_source_schema, e.message] end end end
Version data entries
26 entries across 26 versions & 3 rubygems