Created
October 8, 2013 15:59
-
-
Save zambon/6886984 to your computer and use it in GitHub Desktop.
How to connect to a DB2 database using the Ruby gem ibm_db
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'ibm_db' | |
database = '' | |
host = '' | |
port = '' | |
username = '' | |
password = '' | |
conn_string = "DRIVER={IBM DB2 ODBC DRIVER};DATABASE=#{database};HOSTNAME=#{host};PORT=#{port};PROTOCOL=TCPIP;UID=#{username};PWD=#{password};" | |
IBM_DB.connect(conn_string, '', '') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment