You probably want to call toRowResult():
@Grab('org.hsqldb:hsqldb:2.3.2')
@GrabConfig(systemClassLoader=true)
import groovy.sql.Sql
def sql = Sql.newInstance('jdbc:hsqldb:mem:MyDb', 'sa', '',
'org.hsqldb.jdbcDriver')
sql.execute '''
DROP TABLE MyTable IF EXISTS;
CREATE TABLE MyTable (
i
I was trying to create the list initially in that case and then to xml with
the following code
import groovy.sql.Sql;
import java.sql.ResultSet;
Sql sql = Sql.newInstance("jdbc:oracle:thin:@localhost:1521:XE","username",
"password", "oracle.jdbc.driver.OracleDriver")
def emptyList = []
sql.e
Sure.
On Sun, Jul 31, 2016 at 1:50 PM, GroovyBeginner
wrote:
> Can I achieve this xml output directly after querying to the db?
>
>
>
> --
> View this message in context:
> http://groovy.329449.n5.nabble.com/Convert-Oracle-Result-sets-to-xml-tp5734358p5734375.html
> Sent from the Groovy Dev mail
Can I achieve this xml output directly after querying to the db?
--
View this message in context:
http://groovy.329449.n5.nabble.com/Convert-Oracle-Result-sets-to-xml-tp5734358p5734375.html
Sent from the Groovy Dev mailing list archive at Nabble.com.
{row}" )
> }
>
> return builder.toString()
>
> This code is returning result of lists a sample output would be [ID:1,
> NAME:Test1][ID:2, NAME:Test2] Is there approach of getting this output as
> 1Test12Test2. Any
> help would be much appreciated
>
>
>
> --
> View this message in context:
> http://groovy.329449.n5.nabble.com/Convert-JDBC-Result-sets-to-xml-tp5734358.html
> Sent from the Groovy Dev mailing list archive at Nabble.com.
e output would be [ID:1,
NAME:Test1][ID:2, NAME:Test2] Is there approach of getting this output as
1Test12Test2. Any
help would be much appreciated
--
View this message in context:
http://groovy.329449.n5.nabble.com/Convert-JDBC-Result-sets-to-xml-tp5734358.html
Sent from the Groovy Dev mailing list archive at Nabble.com.