|
RunningAndAccessingDatabase
Running the XML database server and accessing to it -- Client/Server API
IntroductionThe 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. PreparationDownload 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 ServerTo appear. Running the Servera) Running server by a command lineOn 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 Trayc) Running a server in user programAccessing to the ServerXQEngine 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