Am new to groovy. Want to know how to get the number of rows from a given sql result returned form an sql query below. I have googled lot but didn't find the proper solution.
Here is my sql query class code
def sql = Sql.newInstance(dataSource);
try
{
data = sql.rows("select field_value,form_table_column_name from
form_tbl where form_id=1");
sql_one.close()
} catch(Exception e) {
System.out.println(e)
}
To get the count or size of the records returned used data.size()
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With