My favorites | Sign in
Logo
                
Search
for
Updated Jul 23, 2008 by yuin405
Labels: Phase-Implementation, Featured
RunningAndAccessingDatabase  
Running the XML database server and accessing to it -- Client/Server API

Introduction

The XBird engine has the following three facilities: XQuery query (file/stream) processor, client/server XML native database and embedded XML database.

This document introduces a way to run the XML database server and lectures how to access the database in client/server fashion. XBird uses RMI as the internal protocol of remote access, and hence, the embedded access achieved in the same way.

Preparation

Download xbird-xx-src.zip and unzip it. We assume the decompressed directory as $XBIRD_HOME in this document.

Then, put xbird-open-xx.jar into the target directory in $XBIRD_HOME.

Configuring the Server

To appear.

Running the Server

a) Running server by a command line

On the $XBIRD_HOME/bin directory, the following command starts the database server.

-- on windows
$ server.bat 
-- on unix
$ ./server.sh

b) Managing a server instance in System Tray

c) Running a server in user program

Accessing to the Server

XQEngine engine = new XQEngineClient("//knuth.naist.jp:1099/xbird/srv-01");
QueryRequest request1 = new QueryRequest("1+2", ReturnType.REMOTE_SEQUENCE);
Object result1 = engine.execute(request1);
RemoteSequence remoteSequence = (RemoteSequence) result1;

IFocus<Item> focus = remoteSequence.iterator();
Assert.assertEquals(new XInteger(3), focus.next());
Assert.assertFalse(focus.hasNext());

XBird supports three reply patterns: response, callback, and poll. The response reply pattern is used by the default.

Please refer Request class for details.

Running Examples


Sign in to add a comment
Hosted by Google Code