#!/usr/local/bin/ruby require 'dbi' DBI.connect("dbi:Pg:cisedb:postgres.cise.ufl.edu", "myusername", "mypassword" ) { |dbh| dbh.prepare("select * from mytable where mycol = ?") { |sth| sth.execute("myval") sth.each { |row| p row } } }