Difference between revisions of "Java Examples"

From BaseX Documentation
Jump to navigation Jump to search
Line 29: Line 29:
 
;[[UserExample]]
 
;[[UserExample]]
 
:manages database users.
 
:manages database users.
 
==XML:DB API Examples==
 
 
;[[XMLDBCreate]]
 
:creates a collection using XML:DB.
 
 
;[[XMLDBQuery]]
 
:runs a query using XML:DB.
 
 
;[[XMLDBInsert]]
 
:inserts a document into a database using XML:DB.
 
 
==XQJ API Example==
 
 
;[[XQJQuery]]
 
:runs a query using XQJ.
 
  
 
==JAX-RX (REST) API Examples==
 
==JAX-RX (REST) API Examples==
Line 62: Line 46:
 
;[[JaxRxDELETE]]
 
;[[JaxRxDELETE]]
 
:shows the function of the HTTP DELETE method.
 
:shows the function of the HTTP DELETE method.
 +
 +
==XML:DB API Examples==
 +
 +
;[[XMLDBCreate]]
 +
:creates a collection using XML:DB.
 +
 +
;[[XMLDBQuery]]
 +
:runs a query using XML:DB.
 +
 +
;[[XMLDBInsert]]
 +
:inserts a document into a database using XML:DB.
 +
 +
==XQJ API Example==
 +
 +
;[[XQJQuery]]
 +
:runs a query using XQJ.
  
 
[[Category:Developer]]
 
[[Category:Developer]]

Revision as of 22:12, 11 January 2011

The following Java code snippets demonstrate how easy it is to run database commands, create collections, perform queries, etc. via the BaseX API:

Local Examples

RunCommands
creates and drops database and index instances and prints a list of all existing databases.
WikiExample
creates a database from a url (wiki instance), runs a queries against it and drops the database.
RunQueries
shows three variants of running queries.
CreateCollection
creates and manages a collection.
QueryCollection
creates, runs queries against it and drops a collection.

Server Examples

ServerCommands
launches server-side commands with a client session.
ServerAndLocal
processes server results locally.
ServerConcurrency
runs concurrent queries.
UserExample
manages database users.

JAX-RX (REST) API Examples

JaxRxGET
shows the function of the HTTP GET method.
JaxRxPOSTAdd
shows the add function of the HTTP POST method.
JaxRxPOSTQuery
hows the query function of the HTTP POST method.
JaxRxPUT
shows the function of the HTTP PUT method.
JaxRxDELETE
shows the function of the HTTP DELETE method.

XML:DB API Examples

XMLDBCreate
creates a collection using XML:DB.
XMLDBQuery
runs a query using XML:DB.
XMLDBInsert
inserts a document into a database using XML:DB.

XQJ API Example

XQJQuery
runs a query using XQJ.