1 Answer

0 votes
by

Let see a simple example of how Groovy calls out the query

import groovy.sql.sql

sql = Sql.newInstance ('jdbc: jtds: sqlserver://serverName/dbName-Class;domain=domainName','username','password','net.sourceforge.jtds.jdbc.driver')

sql.eachRow ('select * from tableName') {print "$it.id--${it.firstName} –"  }

Related questions

0 votes
    How we can include a groovy script in another groovy?...
asked Sep 25, 2021 in Technology by JackTerrance
0 votes
    How can we build AST (Abstract Syntax Trees) in Groovy from string?...
asked Sep 25, 2021 in Technology by JackTerrance
0 votes
    How can we add stuff to the classpath when running things in groovy or groovysh?...
asked Sep 25, 2021 in Technology by JackTerrance
0 votes
    How could we retrieve a single value from data base using Groovy?...
asked Sep 25, 2021 in Technology by JackTerrance
0 votes
    How can we enable query log in Laravel?...
asked Sep 28, 2021 in Technology by JackTerrance
0 votes
    How can we stop Slow Query Log in MySQL?...
asked Aug 20, 2021 in Technology by JackTerrance
0 votes
    How can we add criteria to a SQL query?...
asked Apr 14, 2021 in Technology by JackTerrance
0 votes
    How Groovy string is expressed?...
asked Sep 25, 2021 in Technology by JackTerrance
0 votes
    Explain how Scripts are run in Groovy?...
asked Sep 25, 2021 in Technology by JackTerrance
0 votes
    What is ExpandoMetaClass in Groovy?...
asked Sep 25, 2021 in Technology by JackTerrance
0 votes
    What is the license for Groovy?...
asked Sep 25, 2021 in Technology by JackTerrance
0 votes
    What is the role of closure and listeners in Groovy?...
asked Sep 25, 2021 in Technology by JackTerrance
0 votes
    What are some features does Groovy JDK offers?...
asked Sep 25, 2021 in Technology by JackTerrance
0 votes
    What is the limitation of Groovy?...
asked Sep 25, 2021 in Technology by JackTerrance
0 votes
    What is the use of Groovy?...
asked Sep 25, 2021 in Technology by JackTerrance
...