Skip to content

Instantly share code, notes, and snippets.

@jinto
Last active December 16, 2015 16:49
Show Gist options
  • Select an option

  • Save jinto/5465460 to your computer and use it in GitHub Desktop.

Select an option

Save jinto/5465460 to your computer and use it in GitHub Desktop.
@Grapes([
@Grab(group='postgresql', module='postgresql', version='8.4-701.jdbc4'),
@GrabConfig(systemClassLoader = true)
])
import groovy.sql.Sql
def sql = Sql.newInstance("jdbc:postgresql://localhost/ebsa_dev", "jinto", "", "org.postgresql.Driver")
i = 0;
sql.eachRow("select * from hotels") {
println "${i++} : name is ${it.name}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment