|
Groovy example source code file (SqlWithTypedResultsTest.groovy)
The Groovy SqlWithTypedResultsTest.groovy source codepackage groovy.sql /** * @author Thomas Heller * @version $Revision: 16054 $ */ class SqlWithTypedResultsTest extends TestHelper { void testSqlQuery() { def sql = createEmptySql() sql.execute("create table groovytest ( anint integer, astring varchar )"); def groovytest = sql.dataSet("groovytest") groovytest.add(anint: 1, astring: "Groovy") groovytest.add(anint: 2, astring: "rocks") Integer id sql.eachRow("SELECT * FROM groovytest ORDER BY anint") { println "found ${it.astring} for id ${it.anint}" id = it.anint } assert id == 2 sql.close() } } Other Groovy examples (source code examples)Here is a short list of links related to this Groovy SqlWithTypedResultsTest.groovy source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.