Advertisement
Guest User

Untitled

a guest
Dec 12th, 2016
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. import groovy.sql.Sql
  2.  
  3. def sql = Sql.newInstance("jdbc:mysql://localhost", "login", "password", "com.mysql.jdbc.Driver")
  4.  
  5. // Display databases
  6. print "Databases: "
  7. println sql.eachRow("SHOW databases") {row -> "${row[0]}"}.collect()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement