Thank you for the pointers, I started again using the XQJ API. I still have
some troubles inserting data into the Collection, however.

Here is a code excerpt, followed by the error I get:

  public boolean addHost(Host h) {
    try
    {
      XStream xs = new XStream();
      xs.alias("Host", h.getClass());
      String xml = xs.toXML(h);
      String query = "insert node " + xml + "  into
collection('Hosts')//Host";
      System.out.println(query);

      XQExpression exp = xqconn.createExpression();
      XQResultSequence rs = exp.executeQuery(query);
      while(rs.next())
        System.out.println("RSItem : " + rs.getItemAsString(null));

      return true;

    } catch (XQException e) {
      System.err.println("Error adding Host entry into the database: " +
e.getMessage());
      return false;
    }
  }

The full query looks like this :
insert node <Host>
  <Name>test1</Name>
  <FreeSpace>32</FreeSpace>
</Host>  into collection('Hosts')//Host

And the error is :
Invalid XQuery syntax, syntax does not pass static validation.

Best Regards,

Luca
------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload 
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve 
application availability and disaster protection. Learn more about boosting 
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
Sedna-discussion mailing list
Sedna-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sedna-discussion

Reply via email to