eXist XQJ API
- Passes over 99% of the TCK.
- Inbuilt connection pooling mechanism.
Quick Start
- Download and install the eXist XML Database.
- Start eXist via either
$EXIST/bin/startup.sh
or %EXIST%/bin/startup.bat
- Download the eXist XQJ API (exist-xqj-api-1.0.1.zip).
- Compile and run the following code.
import javax.xml.xquery.*;
import javax.xml.namespace.QName;
import net.xqj.exist.ExistXQDataSource;
public class QuickStart
{
public static void main(String[] args) throws XQException
{
XQDataSource xqs = new ExistXQDataSource();
xqs.setProperty("serverName", "localhost");
xqs.setProperty("port", "8080");
XQConnection conn = xqs.getConnection();
XQPreparedExpression xqpe =
conn.prepareExpression("declare variable $x as xs:string external; $x");
xqpe.bindString(new QName("x"), "Hello World!", null);
XQResultSequence rs = xqpe.executeQuery();
while(rs.next())
System.out.println(rs.getItemAsString(null));
conn.close();
}
}