4 ms·
No, I'm refering to the groovy.sql.Sql class: http://docs.groovy-lang.org/latest/html/api/groovy/sql/Sql.html http://docs.groovy-lang.org/latest/html/api/groovy
by gregopet 10y ago
No, I'm refering to the groovy.sql.Sql class: http://docs.groovy-lang.org/latest/html/api/groovy/sql/Sql.html http://docs.groovy-lang.org/latest/html/api/groovy/sql/Sql.h...
It allows you to simply write SQL in a GString using placeholders that get replaced with parameters before being sent to the database, here's an example from the Javadoc:
sql.execute "insert into PROJECT (id, name, url) values ($map.id, $map.name, $map.url)"
Works great with Groovy's multiline strings.