Posted By

thebugslayer on 06/02/07


Tagged


Versions (?)

Mysql connection


 / Published in: Groovy
 

  1. //One way to add mysql.jar to path is copy to $HOME/.groovy/lib
  2. import groovy.sql.Sql
  3. sql = Sql.newInstance("jdbc:mysql://localhost:3306/test", "root", "", "com.mysql.jdbc.Driver")
  4. sql.eachRow("show tables"){ row ->
  5. println row[0]
  6. }

Report this snippet  

You need to login to post a comment.