Connect Netezza from Cucumber

564 Views Asked by At

Very simple and short question - how do I connect to Netezza Database from Cucumber.

I am open to use either Ruby or JRuby. I looked at activerecord-netezza-adapter (https://github.com/robbkidd/activerecord-netezza-adapter), but couldn't figure it out how to use it. Any examples of it if you are going to suggest using this gem.

Basically I am looking for a solution that looks like -

Gem File -

    gem 'some gem'

File containing Code / ruby file -

    require 'that good gem'
    some code to connect to netezza database
    some code to execute query to netezza database
1

There are 1 best solutions below

0
On

Got it working, ignore this question, here is what just happened 2 mins back -

require "activerecord-netezza-adapter"
require "activerecord-jdbc-adapter"
require "c:\\jdbc\\nzjdbc.jar"
require "ojdbc14.jar"
require "ActiveRecord.rb"


$CLASSPATH << "c:\\jdbc\\nzjdbc.jar"

@confile = YAML.load_file("connections_details.yml")
@sqlfile = YAML.load_file("queries.yml")
@logFile  = File.open("query_log.yml", 'w+')
@sql_string =  @sqlfile["sql_stmt 1"]["stmt"]


@connection = ActiveRecord::Base.establish_connection(@confile["nzbeta"])
response = @connection.connection.execute(@sql_string)
print response file