Your XEN ICT Team - Ricardo Rodriguez wrote:
The code posted above works fine in Groovy Console. I've installed
Groovy binaries in a MacBook running Mac OS X 10.4.10 and the scripts
work without a glitch. See below...
groovy> import groovy.sql.Sql;
groovy> println "This is a sample to access epec in *mire*"
groovy> def sendSQL =
Sql.newInstance("jdbc:mysql://mire.environmentalchange.net/epec"epec",
"epec_ReadOnly", "epec_ReadOnly", "com.mysql.jdbc.Driver")
groovy> sendSQL.eachRow("SELECT * FROM epec.spot s") {row ->println
"${row.code}"}
This is a sample to access epec in *mire*
AGÑ
BAG
BLA
BDX
BPA
BUI
CAD
CDL
CPD
LUZ
MII
MIM
PDC
PNV
PVO
PZC
QXI
SUA
ACB
SVT
groovy> import groovy.sql.Sql;
groovy> println "This is a sample to access ibdona in *localhost*"
groovy> def sendSQLibd =
Sql.newInstance("jdbc:mysql://localhost/ibdona", "root", "",
"com.mysql.jdbc.Driver")
groovy> sendSQLibd.eachRow("SELECT * FROM ibdona.library_location l")
{row ->println "${row.location}"}
This is a sample to access ibdona in *localhost*
Palma
Pueblos
Ibiza y Menorca
Otras comunidades
Extranjero
Palma
Pueblos
Ibiza y Menorca
Otras comunidades
Palma
Pueblos
Otras comu
Otros
Please, could you figure out why the output is not the same when
executed from a XWiki page? Thanks!
Cheers,
--
Ricardo Rodríguez
Your XEN ICT Team