Sedna XQJ API
- Passes over 99% of the TCK.
Quick Start
- Download and install the Sedna XML Database.
- Create a Database called
"test"
and start it.
- Download the Sedna XQJ API (sedna-xqj-api.zip).
- Compile and run the following code.
import javax.xml.xquery.*;
import javax.xml.namespace.QName;
import net.xqj.sedna.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();
}
}