First thing to check:
Are you logged in as admin or a standard user?  And do you definitely have 
programming rights if you're a standard user?

Second thing to check:
Could be an older version of Groovy in xwiki than what you're testing with in 
your scripts.  I know this sort of scripting worked fine back with the Beta 
v1.0 of xwiki (haven't had the need for such scripts since), as I had to make 
use of it.
 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Your XEN ICT 
Team - Ricardo Rodriguez
Sent: 01 November 2007 09:31
To: XWiki Users
Subject: Re: [xwiki-users] Adding a document in XWiki.org

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_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

_______________________________________________
users mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________
users mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/users

Reply via email to