Changes

Jump to navigation Jump to search
1 byte added ,  14:54, 19 September 2011
no edit summary
This page presents the code structure of the BaseX clients ,andthe client/server protocol of BaseX that is needed towrite [[Clients]] in other programming languages.
==Description==
* First of all, the BaseX database server must be running in order towork with use the clients.
* Each client provides a session class or script with methodsto connect to and communicate with the database server. A socket connection will be established by the constructor, which expects a host, port, user name and password as arguments.
A socket connection will be established by * For the constructor, whichexpects a host, port, user name and password execution of commands you need to call the <code>execute()</code> method with the database command as argumentsargument. The method returns the result or throws an exception with the received error message.
For the execution of commands you need to call the * The <code>executequery()</code>method with the database command as argumentcreates a query instance. The method returns Variables can be bound to that object, and theresult can either be requested by <code>execute()</code>, or throws in an exception iterative manner with the received <code>more()</code> and <code>next()</code> functions. If an error messageoccurs, an exception will be thrown.
To speedup execution* The <code>create()</code>, an output stream <code>add()</code>, <code>replace()</code> and <code>store()</code> method can be specified by some clients;this way, all results will be directed used to pass on input streams to that output streamthe corresponding database commands.
The <code>query()</code> method creates a query instance. Variables can bebound to that object* To speed up execution, and the result an output stream can either be requested specified by<code>execute()</code>some clients; this way, or in an iterative manner with the<code>more()</code> and <code>next()</code> functions.If an error occurs, an exception all results will be throwndirected to that output stream.
The <code>create()</code>, <code>add()</code>, <code>replace()</code>and <code>store()</code> method can be used to pass on input streamsto the corresponding database commands. * Most clients are accompanied by some example files, which demonstratehow database commands can be executed or how queries can be evaluated.
==Code Structure==
Bureaucrats, editor, reviewer, Administrators
13,554

edits

Navigation menu