grails执行sql,调用存储过程

import groovy.sql.Sql

class TestService{

def dataSource//注入数据源

def execute(){
    def db = new Sql(dataSource)
    db.rows('select * from user')
    db.eachRow('select * from user'){ println it }
    db.rows('call stp_select_user()')
}

}

编程技巧