Software AG's CentraSite adds useful facilities to the XQJ interface for updating a database and for inserting a document into the CentraSite registry/repository. These facilities are described in the following sections.
Using the CentraSite XQJ interface, you can update the registry/repository. This feature is a Software AG specific extension of XQJ.
To update an XQuery
Specify the string or the reader object containing the update XQuery
Invoke the executeUpdate()
method on the
expression
String updateQuery = "update for $q in input()/bib/book where $q/@year = 1994" + "do replace $q/title with <title>XQJ from SoftwareAG </title>"; XQResultSequence xqResultSequence = ((XQExpressionImpl)expression).executeUpdate(updateQuery); // execute update
This feature is a Software AG specific extension of XQJ.
To insert a document in the CentraSite Registry/Repository
Specify the XML instance to be inserted as a string or the reader object.
Execute the executeInsert()
method in
XQExpression to insert a document.
String insertStr = "<your xml goes here>"; (XQExpressionImpl)expression).executeInsert(insertStr);