Create Sql
import groovy.sql.Sql
beans = {
sql(Sql, ref('dataSource')) { bean ->
bean.destroyMethod = 'close'
}
}Sql sql = new Sql(dataSource: Grails.applicationContext.getBean('dataSource'))
// execute your queries
sql.close()Last updated