grails 直接运用sql

grails 直接使用sqlpackage test.sql?import groovy.sql.Sql?class SQLTestService {?def dataSource?? ?

grails 直接使用sql

package test.sql

?

import groovy.sql.Sql

?

class SQLTestService {

?

def dataSource

?

? ? def sqlRun() {

def db = new Sql(dataSource)

db.eachRow('select * from house'){?

println it?

}

? ? }

}