import groovy.sql.Sql;
class YourController {
def dataSource ;
.....
def print = {
.....
def sql = new Sql(dataSource);
List lparams = [startDate, endDate];
def query2 = "select * from invoiceh where trx_date between ? and ? ";
def result = sql.rows(query2,lparams);
...... // fetch the result into your gsp / you can process it further
}
}