发布时间:2022-08-09 文章分类:编程知识 投稿人:赵颖 字号: 默认 | | 超大 打印

import groovy.sql.Sql
class GroovySqlExample1{
static void main(String[] args) {
def sql = Sql.newInstance("jdbc:mysql://localhost:3306/words", "words",
"words", "com.mysql.jdbc.Driver")
sql.eachRow("select * from word"){ row ->
println row.word_id + " " + row.spelling + " " + row.part_of_speech
}
}
}