Hi!
project_trainees(a)amritatech.com wrote:
Hi,
"Configure JNDI data store in application container, where you xwiki
instance is running."
How it should be done ? can any one help?
Regards,
Project trainees.
Have you picked up the statement up here from
http://xwikisql.gradsoft.ua/docs/XWikiSqlPluginGuide.html ? I think it
will be clearer for everybody if you include this link or any other
pointing to the source of the information!
JNDI could be used for accessing any database, but this is a matter
concerning Java, more than XWiki: you don't want to use a JNDI
datasource for XWiki to store its database (or you do, but this is not
what I understand from your messages :-)
Being this table within XWiki schema, there is a lot of methods in XWiki
API that will allow you to gain access to this data.
But if you want to use the familiar SQL, XWikiSql plugin from GradSoft
and/or Groovy groovy.sql.Sql can be of help. XWikiSQL plugin requires a
JNDI source to be defined. groovy.sql.Sql doesn't. But I don't know what
of both betters is the best one or it could depend on the scenario.
As for Groovy, look for instance at this simple script I am using to
retrieve data from another MySQL database:
<%
import groovy.sql.Sql
db = Sql.newInstance("jdbc:mysql://myhost/mydatabase", "username",
"password", "com.mysql.jdbc.Driver")
List samplesIA = db.rows('SELECT * FROM saltmines s where es like "I"
and ess like "A" and ids>=1')
%>
As I am trying to understand how this must be done, I will this thread
posted with any new finding or solution. Your feedback is more than
welcome! Thanks.
Hope this helps,
Ricardo
--
Ricardo Rodríguez
Your EPEC Network ICT Team