I use the following code to render data in JSON format.
render(contentType:\"text/json\") { results = array { db.eachRow(query) { row ->
Only off by a little bit :) Just need to change
aMap.put("A", a)
to be a collection or list, rather than a map. so something like
def aList = [] aList << a
Will get you what you want!
As a sidenote, there is a JSON converter in grails that will do that string building for you. Look into it here