groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GroovyBeginner <>
Subject Re: Convert JDBC Result sets to xml
Date Sun, 31 Jul 2016 09:43:01 GMT
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.eachRow("select * FROM A") { row -> 
and the result which am getting is like
groovy.sql.GroovyResultSetExtension@5a632bc3]. How do I convert this to the
actual result. Also am a doing the correct approach initially by including
all the results into a empty list and then converting it to xml.

Please suggest me if there is any better approach of converting the db
results into xml.

View this message in context:
Sent from the Groovy Dev mailing list archive at

View raw message