Class: PuppetX::Sqlserver::SqlConnection

Inherits:
Object
  • Object
show all
Defined in:
lib/puppet_x/sqlserver/sql_connection.rb

Instance Method Summary collapse

Instance Method Details

#open_and_run_command(query, config) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/puppet_x/sqlserver/sql_connection.rb', line 7

def open_and_run_command(query, config)
  begin
    open(config)
    execute(query)
  rescue win32_exception => e
    return ResultOutput.new(true, e.message)
  ensure
    close
  end

  ResultOutput.new(false, nil)
end