I am using Selenium RC and Ruby. I want to fetch out data from a table in SQL Server 2005, using ODBC driver.

My connection code is:

require 'dbi'

conn = DBI.connect('DBI:ODBC:My_Data Source', 'username', 'password')
sth = conn.execute("SELECT * from table_name")
rows = sth.fetch_all
col_names = sth.column_names
DBI::Utils::TableFormatter.ascii(col_names, rows)

This code connects Ruby to database but does not display the data from the table.

If any one has any idea, please share here.
Your help is highly appreciated.

Thanks in Advance.