can any one know about this kind of probelm.??
 
please help:
 
thanks
 
laxma

Laxma Reddy Dendi <[EMAIL PROTECTED]> wrote:
Hi All,
   I am getting error while trying to execute xupdate query:
 
   i am trying the following code:
 
import org.xmldb.api.base.*;
import org.xmldb.api.modules.*;
import org.xmldb.api.*;
public class StudentsXupdate {
   public static void main(String[] args) throws Exception {
      Collection col = null;
      try {
         String driver = "org.apache.xindice.client.xmldb.DatabaseImpl";
         Class c = Class.forName(driver);
         Database database = (Database) c.newInstance();
         DatabaseManager.registerDatabase(database);
         col = DatabaseManager.getCollection("xmldb:xindice://localhost:8080/db/studentsdb");
            String xupd = "<xupdate:modifications version=\"1.0\"" + " xmlns:xupdate=\"http://www.xmldb.org/xupdate\">";
            xupd+="   <xupdate:update select=\"/students/[EMAIL PROTECTED] = '781111']\">" ;
   xupd+= "781114" + "   </xupdate:update>" + "</xupdate:modifications>";

            XUpdateQueryService service =
               (XUpdateQueryService) col.getService("XUpdateQueryService", "1.0");
            long num=service.update(xupd);
            System.out.println("number is: "+num);
      }
      catch (XMLDBException e) {
         System.err.println("XML:DB Exception occurred " + e.errorCode);
      }
      finally {
          if (col != null) { col.close();}
      }
   }
}
 
here is my document:
C:\>xindice rd -c xmldb:xindice://localhost:8080/db/studentsdb -n students
trying to register database
<?xml version="1.0"?>
<students>
   <student sid="781111">
      <name>Laxma R Dendi</name>
      <degree>M.S</degree>
      <major>Computer Science</major>
   </student>
   <student sid="999999">
      <name>Guest</name>
      <degree>M.S</degree>
      <major>Computer Science</major>
   </student>
</students>
 
 
i am getting the following error:
 
C:\>java StudentsXupdate
trying to register database
org.xmldb.api.base.XMLDBException: org.apache.xmlrpc.XmlRpcException: Error exec
uting XUpdate query
        at org.apache.xindice.client.xmldb.xmlrpc.CollectionImpl.runRemoteComman
d(CollectionImpl.java:119)
        at org.apache.xindice.client.xmldb.xmlrpc.CollectionImpl.query(Collectio
nImpl.java:515)
        at org.apache.xindice.client.xmldb.XindiceCollection.query(XindiceCollec
tion.java:259)
        at org.apache.xindice.client.xmldb.services.QueryService.query(QueryServ
ice.java:90)
        at org.apache.xindice.client.xmldb.services.XUpdateQueryServiceImpl.upda
te(XUpdateQueryServiceImpl.java:81)
        at StudentsXupdate.main(StudentsXupdate.java:25)
XML:DB Exception occurred 1
 
thanks in advance.
 
sincerely
Laxma
 


Do you Yahoo!?
Vote for the stars of Yahoo!'s next ad campaign!


Do you Yahoo!?
Vote for the stars of Yahoo!'s next ad campaign!

Reply via email to