Java Examples

From BaseX Documentation
Revision as of 09:43, 6 June 2013 by CG (talk | contribs)
Jump to navigation Jump to search

This page is part of the Developer Section. The following Java code snippets demonstrate how easy it is to run database commands, create collections, perform queries, etc. via the BaseX API. Most examples are taken from our basex-examples repository, in which you will find some more use cases.

Our current XQJ API is based on Charles Foster’s XQJ implementation, which fully utilized the client/server architecture of BaseX. Note that the older XML:DB API can only be used in embedded mode.

Local Examples

  • RunCommands.java
    creates and drops database and index instances, prints a list of all existing databases.
  • WikiExample.java
    creates a database from an url (wiki instance), runs a query against it and drops the database.

Server Examples

 

REST API

XML:DB API (deprecated)