This file contains hidden or 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 'dbi' | |
require 'dbd_odbc_patch' | |
dbh = DBI.connect("dbi:ODBC:DRIVER=FreeTDS;SERVERNAME=dbservername;DATABASE=MyDBName", "username", "password") | |
sth = dbh.prepare("select 1") | |
sth.execute | |
while row=sth.fetch do | |
p row | |
end |
This file contains hidden or 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
# This file is installed by FreeTDS if no file by the same | |
# name is found in the installation directory. | |
# | |
# For information about the layout of this file and its settings, | |
# see the freetds.conf manpage "man freetds.conf". | |
# Global settings are overridden by those in a database | |
# server specific section | |
[global] | |
# TDS protocol version |
This file contains hidden or 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
[FreeTDS] | |
Description = FreeTDS unixODBC Driver | |
Driver = /usr/lib/libtdsodbc.so.0 | |
Setup = /usr/lib/libtdsodbc.so.0 | |
UsageCount = 1 |
This file contains hidden or 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
# | |
# Monkey patch DBD::ODBC to pass usernames and passwords along | |
# to the DB driver correctly | |
# | |
# Are you running a new version of DBI? | |
begin | |
require 'dbd/ODBC' | |
rescue Exception | |
end |
NewerOlder