class DatabaseMethods

Public Class Methods

close_connection(schema) click to toggle source
# File lib/anhpham/methods/database_methods.rb, line 15
def self.close_connection (schema)
  case $db_type.to_sym
    when :sql_server then
      conn = IFD_Connections.get_sql_server_db_connection(schema)
      conn.close
    when :mysql then
      conn = IFD_Connections.get_mysql_db_connection(schema)
      conn.close
  end
end
execute_select(schema,sql) click to toggle source
# File lib/anhpham/methods/database_methods.rb, line 2
def self.execute_select (schema,sql)
  case $db_type.to_sym
    when :sql_server then
      conn = IFD_Connections.get_sql_server_db_connection(schema)
      conn.execute sql
    when :mysql then
      conn = IFD_Connections.get_mysql_db_connection(schema)
      conn.query sql
    else
      raise "*** ERROR: schema type (#{$db_type}) is not supported (SQL SERVER, MY SQL)."
  end
end