import
org.basex.server.*;import
java.io.*;public
class Test { public static final void main(String[] args) { try {ClientSession session =
new ClientSession("localhost", 1984, "admin", "admin");session.create(
"mydb", new ByteArrayInputStream("<Root1/>".getBytes("UTF-8")));session.execute(
"OPEN mydb");session.add(
"mydoc.xml", "/mypath", new ByteArrayInputStream("<Root2/>".getBytes("UTF-8")));session.execute(
"DELETE /mypath/mydoc.xml");String req =
"for $i in collection() return base-uri($i)";Query q = session.query(req);
System.
out.println(q.execute());System.
out.println(q.info());q.close();
session.execute(
"CLOSE");session.close();
session =
new ClientSession("localhost", 1984, "admin", "admin");session.execute(
"DROP DATABASE mydb");session.close();
}
catch (Exception e) {e.printStackTrace();
}
}
}
Fabrice Etanchaud
Senior Software Engineer
CT Corsearch / Edital, a Wolters Kluwer business
Berkenlaan 1
1831 Diegem
Belgium
Get Skype and call me for free.
www.edital.com (website) www.ctcorsearch.com (website)
Confidentiality Notice: This email and its attachments (if any) contain confidential information of the sender. The information is intended only for the use by the direct addressees of the original sender of this email. If you are not an intended recipient of the original sender (or responsible for delivering the message to such person), you are hereby notified that any review, disclosure, copying, distribution or the taking of any action in reliance of the contents of and attachments to this email is strictly prohibited. If you have received this email in error, please immediately notify the sender at the address shown herein and permanently delete any copies of this email (digital or paper) in your possession.