You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xindice-users@xml.apache.org by Matt Allbeury <ma...@clinicdesign.com.au> on 2003/06/02 06:55:13 UTC
Using Xindice 1.1 from JSP/Java
Hi there,
Does anyone know how to connect to an Xindice 1.1 database running under
Tomcat, created from the WAR file?
With version 1 I used:
db = (Database)Class.forName
("org.apache.xindice.client.xmldb.DatabaseImpl").newInstance ();
DatabaseManager.registerDatabase (db);
col = DatabaseManager.getCollection ("xmldb:xindice:///db");
Which worked when Xindice was running as an application.
Any help would be much appreciated.
Cheers
Matt
-----------------------------------------
Matt Allbeury
Senior Web Developer
Clinic Design & New Media
31 Fullarton Road
Kent Town
SA 5067
Ph: 08 8363 8367
Fax: 08 8363 8379
RE: Using Xindice 1.1 from JSP/Java
Posted by Trevor Leung <tr...@cuhk.edu.hk>.
Hi,
I have tried to connect to an Xindice 1.1 with JSP and Servlet to build some application running on Tomcat, it is works.
But you should ensure that you can type "xindice lc -c /db" to list Xindice with Tomcat, and can user command tools
(http://xml.apache.org/xindice/dev/guide-commandline.html) to create, add, delete collections and documents.
And the collection should be "xmldb:xindice:///db/your_new_collection"
In your JSP or Servlet, you may import the following
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
I hope it may help.
Regards,
Trevor
Chinese NewsML Community
CUHK
-----Original Message-----
From: Matt Allbeury [mailto:matt@clinicdesign.com.au]
Sent: Monday, June 02, 2003 12:55 PM
To: xindice-users@xml.apache.org
Subject: Using Xindice 1.1 from JSP/Java
Hi there,
Does anyone know how to connect to an Xindice 1.1 database running under Tomcat, created from the WAR file?
With version 1 I used:
db = (Database)Class.forName ("org.apache.xindice.client.xmldb.DatabaseImpl").newInstance ();
DatabaseManager.registerDatabase (db);
col = DatabaseManager.getCollection ("xmldb:xindice:///db");
Which worked when Xindice was running as an application.
Any help would be much appreciated.
Cheers
Matt
-----------------------------------------
Matt Allbeury
Senior Web Developer
Clinic Design & New Media
31 Fullarton Road
Kent Town
SA 5067
Ph: 08 8363 8367
Fax: 08 8363 8379