Skip to main content

Developing with XCC

Sample Applications

The source code and API documentation for the sample applications are includes in the XCC packages.

The Java distribution of XCC includes marklogic-xcc-jar-N.x.jar and marklogic-xcc-examples-N.jar files. The commands to launch the sample programs in this section assume you have renamed these jar files to xcc.jar and xccexamples.jar, respectively. The commands to launch the sample programs also assume the XCC Java distribution is installed in XCC_HOME.

The sample applications are as follows:

Sample

Description

ContentFetcher

This class fetches documents from the conentbase and writes their serialized contents to a provided OutputStream.

ContentLoader

This program accepts a server URI (in the format expected by ContentSourceFactory.newContentSource(java.net.URI)) and one or more file pathnames of documents to load.

DynamicContentStream

This program demonstrates inserting unbuffered, chunkable dynamic content into the database without spawning a new thread.

HelloSecureWorld

This simple program prints out the string Hello World, using SSL/TLS to connect to MarkLogic Server.

HelloWorld

This simple program prints out the string Hello World.

ModuleRunner

This simple program invokes a named XQuery module on the server and return the result.

OutputStreamInserter

This program demonstrates inserting unbuffered dynamic content into the database by spawning a new thread to write the data.

SimpleQueryRunner

This is a very simple class that will submit an XQuery string to the server and return the result.

XA

This program demonstrates using MarkLogic Server in a distributed XA transaction, using JBoss as the Transaction Manager.