Sedna XQJ API (BETA 1)

Sedna XQJ Driver

The XQuery API for Java™

The JCP released the final version of the XQuery API for Java™ (XQJ) specification on the 24th of June 2009. The expert group backing it's development included Oracle, Intel, Nokia, Software AG and Jason Hunter to name a few.

Sedna XQJ API Specific Features

NOTICE: This is an early BETA version. This software is still under development!

Please report bugs here.

Getting the party started

import javax.xml.xquery.*;
import javax.xml.namespace.QName;
import net.cfoster.sedna.xqj.SednaXQDataSource;

public class QuickStart
{
  public static void main(String[] args) throws XQException
  {
    XQDataSource xqs = new SednaXQDataSource();
    xqs.setProperty("serverName", "localhost");
    xqs.setProperty("databaseName", "test");

    XQConnection conn = xqs.getConnection("SYSTEM", "MANAGER");

    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();
  }
}

XQJ Tutorial, throw me a bone!

There is an XQJ Tutorial here on this site for use with the Sedna XQJ API.

API Javadocs for the XQJ API can be found here.

Start playing with Sedna XQJ (BETA 1) now!