Chariot Training Classes

Training Courses

I run Chariot's training and mentoring services. We provide training in AngularJS, HTML5, Spring, Hibernate, Maven, Scala, and more.

Chariot Education Services


Chariot Emerging Tech

Learn about upcoming technologies and trends from my colleagues at Chariot Solutions.


Chariot Conferences


Entries in griffon (1)


Using the gsql plugin for Griffon

Recently Andres Almiray has added a gsql plugin to Griffon.  This is very cool, as it lets you configure datasources ala' grails, and then inject the Groovy SQL API into your controllers.

Here is how it works:

First, install the plugin by using the instruction

griffon install-plugin gsql 1.0-SNAPSHOT

Next, configure your database connection using the ./griffon-app/conf/DataSource.groovy file, the same way you would a grails app.

Once configured, you may use the withSql closure to inject the Groovy SQL object, pre-initialized via your data source, into your code.  Here is a simple example:

def rows = [];

withSql { sql ->
   sql.eachRow("select name from city") { row ->
      rows <<

There, that wasn't so hard, now was it?

Programming note:  I am recording a Chariot TechCast with Andres tonight and will have it posted sometime next week.  Thanks, Andres!