i am having some difficulty running the following codes:
import org.xmldb.api.base.*;
import org.xmldb.api.modules.*;
import org.xmldb.api.*;
import org.xmldb.api.modules.*;
import org.xmldb.api.*;
/**
* Simple XML:DB API example to update the database.
*/
public class XindiceUpdate {
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:///db/addressbook");
* Simple XML:DB API example to update the database.
*/
public class XindiceUpdate {
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:///db/addressbook");
String xupdate = "<xu:modifications version=\'1.0\'" +
" xmlns:xu=\'http://www.xmldb.org/xupdate\'>" +
" <xu:remove select=\'/person/[EMAIL PROTECTED] = 'home']\'/>" +
" <xu:update select=\'/person/[EMAIL PROTECTED] = 'work']\'>" +
" 480-300-3003" +
" </xu:update>" +
"</xu:modifications>";
" xmlns:xu=\'http://www.xmldb.org/xupdate\'>" +
" <xu:remove select=\'/person/[EMAIL PROTECTED] = 'home']\'/>" +
" <xu:update select=\'/person/[EMAIL PROTECTED] = 'work']\'>" +
" 480-300-3003" +
" </xu:update>" +
"</xu:modifications>";
XUpdateQueryService service =
(XUpdateQueryService) col.getService("XUpdateQueryService", "1.0");
service.update(xupdate);
}
catch (XMLDBException e) {
System.err.println("XML:DB Exception occured " + e.errorCode + " " +
e.getMessage());
}
finally {
if (col != null) {
col.close();
}
}
}
}
(XUpdateQueryService) col.getService("XUpdateQueryService", "1.0");
service.update(xupdate);
}
catch (XMLDBException e) {
System.err.println("XML:DB Exception occured " + e.errorCode + " " +
e.getMessage());
}
finally {
if (col != null) {
col.close();
}
}
}
}
error message which i got was:
org.apache.xindice.client.corba.db.APIException: IDL : org/apache/xindice/client/corba/db/APIException:1.0
Please help me. Thank you
Do you Yahoo!?
Yahoo! Mail - now with 250MB free storage. Learn more.
Do you Yahoo!?
The all-new My Yahoo! – What will yours do?