tkaczanowski

groovy jdbc

Oct 25th, 2012
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Groovy 0.38 KB | None | 0 0
  1. import groovy.sql.Sql
  2. class GroovySqlExample1{
  3.   static void main(String[] args) {
  4.     def sql = Sql.newInstance("jdbc:postgresql://localhost:5432/sonar", "sonar",
  5.            "sonar", "org.postgresql.Driver")
  6.     sql.eachRow("select p.id as id, p.text_value as value, p.resource_id as resourceId, p.user_id as userId     from properties p"){ row ->
  7.        println row
  8.     }
  9.   }
  10. }
Advertisement
Add Comment
Please, Sign In to add comment