Public Member Functions | Protected Member Functions | List of all members
org.zorbaxquery.api.xqj.ZorbaXQConnection Class Reference

A connection (session) with a specific XQuery engine. More...

Inherits XQConnection.

Public Member Functions

void close () throws XQException
 Closes the connection. More...
 
void commit () throws XQException
 Makes all changes made in the current transaction permanent and releases any locks held by the datasource. More...
 
XQItemType createAtomicType (int basetype) throws XQException
 Creates a new ZorbaXQItemType object representing an XQuery atomic type. More...
 
XQItemType createAtomicType (int basetype, QName qname, URI uri) throws XQException
 Creates a new ZorbaXQItemType object representing an XQuery atomic type. More...
 
XQItemType createAttributeType (QName nodename, int basetype) throws XQException
 Creates a new ZorbaXQItemType object representing the XQuery attribute(nodename, basetype) type with the given node name and base type. More...
 
XQItemType createAttributeType (QName nodename, int basetype, QName typename, URI schemaURI) throws XQException
 Creates a new ZorbaXQItemType object representing the XQuery attribute(nodename, basetype) type with the given node name and base type. More...
 
XQItemType createCommentType () throws XQException
 Creates a new ZorbaXQItemType object representing the XQuery comment() type. More...
 
XQItemType createDocumentElementType (XQItemType elementType) throws XQException
 Creates a new ZorbaXQItemType object representing the XQuery document-node(elementType) type containing a single element. More...
 
XQItemType createDocumentSchemaElementType (XQItemType elementType) throws XQException
 Creates a new ZorbaXQItemType object representing the XQuery document-node(elementType) type containing a single schema-element(...). More...
 
XQItemType createDocumentType () throws XQException
 Creates a new ZorbaXQItemType object representing the XQuery document-node() type. More...
 
XQItemType createElementType (QName nodename, int baseType) throws XQException
 Creates a new ZorbaXQItemType object representing the XQuery element(nodename, basetype) type, with the given node name and base type. More...
 
XQItemType createElementType (QName nodename, int baseType, QName typename, URI schemaURI, boolean allowNill) throws XQException
 Creates a new ZorbaXQItemType object representing the XQuery element(nodename,basetype,typename,schemaURI, allowNill) type, given the node name, base type, schema type name, schema URI, and nilled check. More...
 
XQExpression createExpression () throws XQException
 Creates a new ZorbaXQExpression object that can be used to perform execute immediate operations with XQuery expressions. More...
 
XQExpression createExpression (XQStaticContext value) throws XQException
 Creates a new ZorbaXQExpression object that can be used to perform execute immediate operations with XQuery expressions. More...
 
XQItem createItem (XQItem value) throws XQException
 Creates a copy of the specified ZorbaXQItem. More...
 
XQItem createItemFromAtomicValue (String value, XQItemType type) throws XQException
 Creates an item from a given value. More...
 
XQItem createItemFromBoolean (boolean bln, XQItemType type) throws XQException
 
XQItem createItemFromByte (byte b, XQItemType type) throws XQException
 Creates an item from a given value. More...
 
XQItem createItemFromDocument (String value, String baseURI, XQItemType type) throws XQException
 Creates an item from the given value. More...
 
XQItem createItemFromDocument (Reader value, String baseURI, XQItemType type) throws XQException
 Creates an item from the given value. More...
 
XQItem createItemFromDocument (InputStream value, String baseURI, XQItemType type) throws XQException
 Creates an item from the given value. More...
 
XQItem createItemFromDocument (XMLStreamReader value, XQItemType type) throws XQException
 Creates an item from the given value. More...
 
XQItem createItemFromDocument (Source value, XQItemType type) throws XQException
 Creates an item from the given value. More...
 
XQItem createItemFromDouble (double value, XQItemType type) throws XQException
 Creates an item from a given value. More...
 
XQItem createItemFromFloat (float value, XQItemType type) throws XQException
 Creates an item from a given value. More...
 
XQItem createItemFromInt (int value, XQItemType type) throws XQException
 Creates an item from a given value. More...
 
XQItem createItemFromLong (long value, XQItemType type) throws XQException
 Creates an item from a given value. More...
 
XQItem createItemFromNode (Node value, XQItemType type) throws XQException
 Creates an item from a given value. More...
 
XQItem createItemFromObject (Object value, XQItemType type) throws XQException
 Creates an item from a given value. More...
 
XQItem createItemFromShort (short value, XQItemType type) throws XQException
 Creates an item from a given value. More...
 
XQItem createItemFromString (String value, XQItemType type) throws XQException
 Creates an item from a given value. More...
 
XQItemType createItemType () throws XQException
 Creates a new ZorbaXQItemType object representing the XQuery item type. More...
 
XQItemType createNodeType () throws XQException
 Creates a new ZorbaXQItemType object representing the XQuery node() type. More...
 
XQItemType createProcessingInstructionType (String piTarget) throws XQException
 Creates a new ZorbaXQItemType object representing the XQuery processing-instruction(piTarget) type. More...
 
XQItemType createSchemaAttributeType (QName nodename, int basetype, URI uri) throws XQException
 Creates a new ZorbaXQItemType object representing the XQuery schema-attribute(nodename,basetype,schemaURI) type, with the given node name, base type, and schema URI. More...
 
XQItemType createSchemaElementType (QName nodename, int baseType, URI schemaURI) throws XQException
 Creates a new ZorbaXQItemType object representing the XQuery schema-element(nodename,basetype,schemaURI) type, given the node name, base type, and the schema URI. More...
 
XQSequence createSequence (XQSequence value) throws XQException
 Creates a copy of the specified ZorbaXQSequence. More...
 
XQSequence createSequence (Iterator value) throws XQException
 Creates an ZorbaXQSequence, containing all the items from the iterator. More...
 
XQSequenceType createSequenceType (XQItemType item, int occurence) throws XQException
 Creates a new sequence type from an item type and occurence indicator. More...
 
XQItemType createTextType () throws XQException
 Creates a new ZorbaXQItemType object representing the XQuery text() type. More...
 
boolean getAutoCommit () throws XQException
 Gets the auto-commit attribute of this connection. More...
 
XQMetaData getMetaData () throws XQException
 Gets the metadata for this connection. More...
 
XQStaticContext getStaticContext () throws XQException
 Gets an ZorbaXQStaticContext representing the default values for all expression properties. More...
 
ZorbaXQXmlDataManager getXmlDataManager ()
 
boolean isClosed ()
 Checks if the connection is closed. More...
 
XQPreparedExpression prepareExpression (String value) throws XQException
 Prepares an expression for execution. More...
 
XQPreparedExpression prepareExpression (String string, XQStaticContext xqsc) throws XQException
 Prepares an expression for execution. More...
 
XQPreparedExpression prepareExpression (Reader reader) throws XQException
 Prepares an expression for execution. More...
 
XQPreparedExpression prepareExpression (Reader reader, XQStaticContext xqsc) throws XQException
 Prepares an expression for execution. More...
 
XQPreparedExpression prepareExpression (InputStream in) throws XQException
 Prepares an expression for execution. More...
 
XQPreparedExpression prepareExpression (InputStream in, XQStaticContext xqsc) throws XQException
 Prepares an expression for execution. More...
 
void rollback () throws XQException
 Undoes all changes made in the current transaction and releases any locks held by the datasource. More...
 
void setAutoCommit (boolean bln) throws XQException
 
void setStaticContext (XQStaticContext xqsc) throws XQException
 Sets the default values for all expression properties. More...
 
 ZorbaXQConnection ()
 
 ZorbaXQConnection (Properties aProperties)
 

Protected Member Functions

Zorba getZorbaInstance () throws XQException
 

Detailed Description

A connection (session) with a specific XQuery engine.

Connections are obtained through an ZorbaXQDataSource object.

XQuery expressions are executed and results are returned within the context of a connection. They are either executed through ZorbaXQExpression or ZorbaXQPreparedExpression objects.

ZorbaXQDataSource ds;// obtain the XQuery datasource ... ZorbaXQConnection conn = ds.getConnection();

ZorbaXQPreparedExpression expr = conn.prepareExpression("for $i in ..."); XQResultSequence result = expr.executeQuery(); // - or - ZorbaXQExpression expr = conn.createExpression(); ZorbaXQSequence result = expr.executeQuery("for $i in..");

// The sequence can now be iterated while (result.next()) { String str = result.getItemAsString(); System.out.println(" output "+ str); } result.close(); expr.close(); conn.close(); // close the connection and free all resources..

A connection holds also default values for ZorbaXQExpression and ZorbaXQPreparedExpression properties. An application can override these defaults by passing an ZorbaXQStaticContext object to the setStaticContext() method.

Definition at line 75 of file ZorbaXQConnection.java.

Constructor & Destructor Documentation

org.zorbaxquery.api.xqj.ZorbaXQConnection.ZorbaXQConnection ( )
inline

Definition at line 97 of file ZorbaXQConnection.java.

org.zorbaxquery.api.xqj.ZorbaXQConnection.ZorbaXQConnection ( Properties  aProperties)
inline

Member Function Documentation

void org.zorbaxquery.api.xqj.ZorbaXQConnection.close ( ) throws XQException
inline

Closes the connection.

Closes the connection. This also closes any ZorbaXQExpression and ZorbaXQPreparedExpression obtained from this connection. Once the connection is closed, no method other than close or the isClosed method may be called on the connection object. Calling close on an ZorbaXQConnection object that is already closed has no effect. Note that an XQJ driver is not required to provide finalizer methods for the connection and other objects. Hence it is strongly recommended that users call this method explicitly to free any resources. It is also recommended that they do so under a final block to ensure that the object is closed even when there are exceptions.

Exceptions
XQException- if there is an error during closing the connection.

Definition at line 156 of file ZorbaXQConnection.java.

References org.zorbaxquery.api.xqj.ZorbaXQXmlDataManager.close().

void org.zorbaxquery.api.xqj.ZorbaXQConnection.commit ( ) throws XQException
inline

Makes all changes made in the current transaction permanent and releases any locks held by the datasource.

This method should be used only when auto-commit mode is disabled. Any XQResultSequence, or XQResultItem may be implicitly closed upon commit, if the holdability property of the sequence is set to XQConstants.HOLDTYPE_CLOSE_CURSORS_AT_COMMIT.

Exceptions
XQException- if the connection is in a closed state or this connection is operating in auto-commit mode

Definition at line 211 of file ZorbaXQConnection.java.

XQItemType org.zorbaxquery.api.xqj.ZorbaXQConnection.createAtomicType ( int  basetype) throws XQException
inline

Creates a new ZorbaXQItemType object representing an XQuery atomic type.

The item kind of the item type will be ZorbaXQItemType.XQITEMKIND_ATOMIC. Example -

ZorbaXQConnection conn = ...;
// to create xs:integer item type
conn.createAtomicType(ZorbaXQItemType.XQBASETYPE_INTEGER);
Parameters
basetype- one of the ZorbaXQItemType.XQBASETYPE_* constants. All basetype constants except the following are valid:
ZorbaXQItemType.XQBASETYPE_UNTYPED
ZorbaXQItemType.XQBASETYPE_ANYTYPE
ZorbaXQItemType.XQBASETYPE_IDREFS
ZorbaXQItemType.XQBASETYPE_NMTOKENS
ZorbaXQItemType.XQBASETYPE_ENTITIES
ZorbaXQItemType.XQBASETYPE_ANYSIMPLETYPE
Returns
a new ZorbaXQItemType representing the atomic type
Exceptions
XQException- if (1) an invalid basetype value is passed in, or (2) the underlying object implementing the interface is closed

Definition at line 1548 of file ZorbaXQConnection.java.

XQItemType org.zorbaxquery.api.xqj.ZorbaXQConnection.createAtomicType ( int  basetype,
QName  qname,
URI  uri 
) throws XQException
inline

Creates a new ZorbaXQItemType object representing an XQuery atomic type.

The item kind of the item type will be ZorbaXQItemType.XQITEMKIND_ATOMIC. Example -

ZorbaXQConnection conn = ...;
// to create xs:integer item type
conn.createAtomicType(ZorbaXQItemType.XQBASETYPE_INTEGER);
Parameters
basetype- one of the ZorbaXQItemType.XQBASETYPE_* constants. All basetype constants except the following are valid:
ZorbaXQItemType.XQBASETYPE_UNTYPED
ZorbaXQItemType.XQBASETYPE_ANYTYPE
ZorbaXQItemType.XQBASETYPE_IDREFS
ZorbaXQItemType.XQBASETYPE_NMTOKENS
ZorbaXQItemType.XQBASETYPE_ENTITIES
ZorbaXQItemType.XQBASETYPE_ANYSIMPLETYPE
qname- the QName of the type. If the QName refers to a predefinied type, it must match the basetype. Can be null
uri- the URI to the schema. Can be null. This can only be specified if the typename is also specified
Returns
a new ZorbaXQItemType representing the atomic type
Exceptions
XQException- if (1) an invalid basetype value is passed in, or (2) the underlying object implementing the interface is closed

Definition at line 1579 of file ZorbaXQConnection.java.

XQItemType org.zorbaxquery.api.xqj.ZorbaXQConnection.createAttributeType ( QName  nodename,
int  basetype 
) throws XQException
inline

Creates a new ZorbaXQItemType object representing the XQuery attribute(nodename, basetype) type with the given node name and base type.

This method can be used to create item type for attributes with a pre-defined schema type.

Example -

ZorbaXQConnection conn = ..; // An XQuery connection
- attribute() // no node name, pass null for the node name
conn.createAttributeType(null, ZorbaXQItemType.XQBASETYPE_ANYSIMPLETYPE);
- attribute (*) // equivalent to attribute()
conn.createAttributeType(null, ZorbaXQItemType.XQBASETYPE_ANYSIMPLETYPE);
- attribute (person) // attribute of name person and any simple type.
conn.createAttributeType(new QName("person"), ZorbaXQItemType.XQBASETYPE_ANYSIMPLETYPE);
- attribute(foo:bar) // node name foo:bar, type is any simple type
conn.createAttributeType(new QName("http://www.foo.com", "bar","foo"),
ZorbaXQItemType.XQBASETYPE_ANYSIMPLETYPE);
- attribute(foo:bar, xs:integer) // node name foo:bar, type is xs:integer
conn.createAttributeType(new QName("http://www.foo.com", "bar","foo"),
ZorbaXQItemType.XQBASETYPE_INTEGER);
Parameters
nodename- specifies the name of the node.null indicates a wildcard for the node name
basetype- the base type of the attribute. One of the ZorbaXQItemType.XQBASETYPE_* other than ZorbaXQItemType.XQBASETYPE_UNTYPED or ZorbaXQItemType.XQBASETYPE_ANYTYPE
Returns
a new ZorbaXQItemType representing the XQuery attribute(nodename, basetype) type
Exceptions
XQException- if (1) the underlying object implementing the interface is closed or (2) if the base type is one of: ZorbaXQItemType.XQBASETYPE_UNTYPED or ZorbaXQItemType.XQBASETYPE_ANYTYPE

Definition at line 1631 of file ZorbaXQConnection.java.

XQItemType org.zorbaxquery.api.xqj.ZorbaXQConnection.createAttributeType ( QName  nodename,
int  basetype,
QName  typename,
URI  schemaURI 
) throws XQException
inline

Creates a new ZorbaXQItemType object representing the XQuery attribute(nodename, basetype) type with the given node name and base type.

The type name can reference either pre-defined simple types or user-defined simple types.

Example -

ZorbaXQConnection conn = ..; // An XQuery connection
- attribute (name, employeename) // attribute name of type employeename
conn.createAttributeType(new QName("name"), ZorbaXQItemType.XQBASETYPE_ANYSIMPLETYPE,
new QName("employeename"), null);
- attribute (foo:bar, po:city)
where the prefix foo refers to the namespace http://www.foo.com and the
prefix po refers to the namespace "http://www.address.com"
conn.createAttributeType(new QName("http://www.foo.com", "bar","foo"),
ZorbaXQItemType.XQBASETYPE_ANYSIMPLETYPE,
new QName("http://address.com", "address","po"), null);
- attribute (zip, zipcode) // attribute zip of type zipchode which derives from
// xs:string
conn.createAttributeType(new QName("zip"), ZorbaXQItemType.XQBASETYPE_STRING,
new QName("zipcode"), null);
- attribute(foo:bar, po:hatsize)
where the prefix foo refers to the namespace http://www.foo.com and the
prefix po refers to the namespace "http://www.hatsizes.com"
with schema URI "http://hatschema.com"
conn.createAttributeType(new QName("http://www.foo.com", "bar","foo"),
ZorbaXQItemType.XQBASETYPE_INTEGER,
new QName("http://www.hatsizes.com", "hatsize","po"),
new QName("http://hatschema.com"));
Parameters
nodename- specifies the name of the node.null indicates a wildcard for the node name
basetype- the base type of the attribute. One of the XQItemTyupe.XQBASETYPE_* constants other than ZorbaXQItemType.XQBASETYPE_UNTYPED or ZorbaXQItemType.XQBASETYPE_ANYTYPE
typename- the QName of the type. If the QName refers to a predefinied type, it must match the basetype. Can be null.
schemaURI- the URI to the schema. Can be null. This can only be specified if the typename is also specified
Returns
a new ZorbaXQItemType representing the XQuery attribute(nodename,basetype, typename,schemaURI) type.
Exceptions
XQException- if (1) the underlying object implementing the interface is closed, (2) if the base type is one of: ZorbaXQItemType.XQBASETYPE_UNTYPED or ZorbaXQItemType.XQBASETYPE_ANYTYPE, (3) the schema URI is specified and the typename is not specified, (4) the implementation does not support user-defined XML schema types, or (5) if the typename refers to a predefinied type and does not match basetype

Definition at line 1684 of file ZorbaXQConnection.java.

XQItemType org.zorbaxquery.api.xqj.ZorbaXQConnection.createCommentType ( ) throws XQException
inline

Creates a new ZorbaXQItemType object representing the XQuery comment() type.

Creates a new ZorbaXQItemType object representing the XQuery comment() type. The ZorbaXQItemType object will have the item kind set to ZorbaXQItemType.XQITEMKIND_COMMENT.

Example -

ZorbaXQConnection conn = ..; // An XQuery connection
ZorbaXQItemType cmttype = conn.createCommentType();
int itemkind = cmttype.getItemKind(); // will be ZorbaXQItemType.XQITEMKIND_COMMENT
ZorbaXQExpression expr = conn.createExpression();
ZorbaXQSequence result = expr.executeQuery("<!-- comments -->");
result.next();
boolean pi = result.instanceOf(cmttype); // will be true
Returns
a new ZorbaXQItemType representing the XQuery comment() type
Exceptions
XQException- if the underlying object implementing the interface is closed

Definition at line 1743 of file ZorbaXQConnection.java.

XQItemType org.zorbaxquery.api.xqj.ZorbaXQConnection.createDocumentElementType ( XQItemType  elementType) throws XQException
inline

Creates a new ZorbaXQItemType object representing the XQuery document-node(elementType) type containing a single element.

Creates a new ZorbaXQItemType object representing the XQuery document-node(elementType) type containing a single element. The ZorbaXQItemType object will have the item kind set to ZorbaXQItemType.XQITEMKIND_DOCUMENT_ELEMENT and the base type set to the item type of the input elementType.

Parameters
elementType- an ZorbaXQItemType object representing an XQuery element() type, cannot be null
Returns
a new ZorbaXQItemType representing the XQuery document-node(elementType) type containing a single element
Exceptions
XQException- if (1) the underlying object implementing the interface is closed or (2) the elementType has an item kind different from ZorbaXQItemType.XQITEMKIND_ELEMENT, (3) the elementType argument is null, or (4) the implementation does not support user-defined XML schema types

Definition at line 1757 of file ZorbaXQConnection.java.

XQItemType org.zorbaxquery.api.xqj.ZorbaXQConnection.createDocumentSchemaElementType ( XQItemType  elementType) throws XQException
inline

Creates a new ZorbaXQItemType object representing the XQuery document-node(elementType) type containing a single schema-element(...).

The ZorbaXQItemType object will have the item kind set to ZorbaXQItemType.XQITEMKIND_DOCUMENT_SCHEMA_ELEMENT and the base type set to the item type of the input elementType.

Parameters
elementType- an ZorbaXQItemType object representing an XQuery schema-element(...) type, cannot be null
Returns
a new ZorbaXQItemType representing the XQuery document-node(elementType) type containing a single schema-element(...) element
Exceptions
XQException- if (1) the underlying object implementing the interface is closed or (2) the elementType has an item kind different from ZorbaXQItemType.XQITEMKIND_SCHEMA_ELEMENT, (3) the elementType argument is null, (4) the implementation does not support user-defined XML schema types

Definition at line 1775 of file ZorbaXQConnection.java.

XQItemType org.zorbaxquery.api.xqj.ZorbaXQConnection.createDocumentType ( ) throws XQException
inline

Creates a new ZorbaXQItemType object representing the XQuery document-node() type.

The ZorbaXQItemType object will have the item kind set to ZorbaXQItemType.XQITEMKIND_DOCUMENT.

Returns
a new ZorbaXQItemType representing the XQuery document-node() type
Exceptions
XQException- if the underlying object implementing the interface is closed

Definition at line 1791 of file ZorbaXQConnection.java.

XQItemType org.zorbaxquery.api.xqj.ZorbaXQConnection.createElementType ( QName  nodename,
int  baseType 
) throws XQException
inline

Creates a new ZorbaXQItemType object representing the XQuery element(nodename, basetype) type, with the given node name and base type.

This method can be used to create item type for elements with a pre-defined schema type.

Example -

ZorbaXQConnection conn = ..; // An XQuery connection
- element() // no node name, pass null for the node name
conn.createElementType(null, ZorbaXQItemType.XQBASETYPE_ANYTYPE);
- element (*) // equivalent to element()
conn.createElementType(null, ZorbaXQItemType.XQBASETYPE_ANYTYPE);
- element(person) // element of name person and any type.
conn.createElementType(new QName("person"), ZorbaXQItemType.XQBASETYPE_ANYTYPE);
- element(foo:bar) // node name foo:bar, type is anytype
conn.createElementType(new QName("http://www.foo.com", "bar","foo"),
ZorbaXQItemType.XQBASETYPE_ANYTYPE);
- element(foo:bar, xs:integer) // node name foo:bar, type is xs:integer
conn.createElementType(new QName("http://www.foo.com", "bar","foo"),
ZorbaXQItemType.XQBASETYPE_INTEGER);
Parameters
nodename- specifies the name of the node. null indicates a wildcard for the node name
baseType- the base type of the item. One of the ZorbaXQItemType.XQBASETYPE_* constants
Returns
a new ZorbaXQItemType representing the XQuery element(nodename, basetype) type
Exceptions
XQException- if (1) the underlying object implementing the interface is closed

Definition at line 1831 of file ZorbaXQConnection.java.

Referenced by org.zorbaxquery.api.xqj.ZorbaXQConnection.createItemFromDocument().

XQItemType org.zorbaxquery.api.xqj.ZorbaXQConnection.createElementType ( QName  nodename,
int  baseType,
QName  typename,
URI  schemaURI,
boolean  allowNill 
) throws XQException
inline

Creates a new ZorbaXQItemType object representing the XQuery element(nodename,basetype,typename,schemaURI, allowNill) type, given the node name, base type, schema type name, schema URI, and nilled check.

The type name can reference either pre-defined schema types or user-defined types.

Example -

ZorbaXQConnection conn = ..; // An XQuery connection
- element (person, employee) // element person of type employee
conn.createElementType(new QName("person"), ZorbaXQItemType.XQBASETYPE_ANYTYPE,
new QName("employee"), null ,false);
- element(person, employee ? ) // element person of type employee, whose nilled
// property may be true or false.
conn.createElementType(new QName("person"), ZorbaXQItemType.XQBASETYPE_ANYTYPE,
new QName("employee"), null ,true);
- element(foo:bar, po:address)
where the prefix foo refers to the namespace http://www.foo.com and the
prefix po refers to the namespace "http://www.address.com"
conn.createElementType(new QName("http://www.foo.com", "bar","foo"),
ZorbaXQItemType.XQBASETYPE_ANYTYPE,
new QName("http://address.com", "address","po"), null, false);
- element (zip, zipcode) // element zip of type zipchode which derives from
// xs:string
conn.createElementType(new QName("zip"), ZorbaXQItemType.XQBASETYPE_STRING,
new QName("zipcode"), null, false);
- element (*, xs:anyType ?)
conn.createElementType(null, ZorbaXQItemType.XQBASETYPE_ANYTYPE, null, null, true);
- element(foo:bar, po:hatsize)
where the prefix foo refers to the namespace http://www.foo.com and the
prefix po refers to the namespace "http://www.hatsizes.com"
with schema URI "http://hatschema.com"
conn.createElementType(new QName("http://www.foo.com", "bar","foo"),
ZorbaXQItemType.XQBASETYPE_INTEGER,
new QName("http://www.hatsizes.com", "hatsize","po"),
new QName("http://hatschema.com"), false);
Parameters
nodename- specifies the name of the element. null indicates a wildcard for the node name
baseType- the base type of the item. One of the ZorbaXQItemType.XQBASETYPE_* constants
typename- the QName of the type. If the QName refers to a predefinied type, it must match the basetype. Can be null
schemaURI- the URI to the schema. Can be null. This can only be specified if the typename is also specified
allowNill- the nilled property of the element
Returns
a new ZorbaXQItemType representing the XQuery element(nodename,basetype, typename,schemaURI, allowNill) type
Exceptions
XQException- if (1) schemaURI is specified but the typename is not specified, (2) the underlying object implementing the interface is closed, (3) the implementation does not support user-defined XML schema types, or (4) if the typename refers to a predefinied type and does not match basetype

Definition at line 1895 of file ZorbaXQConnection.java.

XQExpression org.zorbaxquery.api.xqj.ZorbaXQConnection.createExpression ( ) throws XQException
inline

Creates a new ZorbaXQExpression object that can be used to perform execute immediate operations with XQuery expressions.

The properties of the connection's default ZorbaXQStaticContext are copied to the returned ZorbaXQExpression.

Returns
ZorbaXQExpression that can be used to execute multiple expressions
Exceptions
XQException- if the connection is in a closed state

Definition at line 224 of file ZorbaXQConnection.java.

XQExpression org.zorbaxquery.api.xqj.ZorbaXQConnection.createExpression ( XQStaticContext  value) throws XQException
inline

Creates a new ZorbaXQExpression object that can be used to perform execute immediate operations with XQuery expressions.

The properties of the specified ZorbaXQStaticContext values are copied to the returned ZorbaXQExpression.

Parameters
value- ZorbaXQStaticContext containing values of expression properties
Returns
ZorbaXQExpression that can be used to execute multiple expressions
Exceptions
XQException- if (1) the connection is in a closed state, or (2) the specified argument is null

Definition at line 245 of file ZorbaXQConnection.java.

XQItem org.zorbaxquery.api.xqj.ZorbaXQConnection.createItem ( XQItem  value) throws XQException
inline

Creates a copy of the specified ZorbaXQItem.

This method can be used, for example, to copy an XQResultItem object so that the new item is not dependant on the connection.

Parameters
value- the ZorbaXQItem to copy
Returns
ZorbaXQItem independent of any underlying ZorbaXQConnection is created
Exceptions
XQException- if (1) the specified item is null, (2) the underlying object implementing the interface is closed, (3) the specified item is closed

Definition at line 1478 of file ZorbaXQConnection.java.

XQItem org.zorbaxquery.api.xqj.ZorbaXQConnection.createItemFromAtomicValue ( String  value,
XQItemType  type 
) throws XQException
inline

Creates an item from a given value.

The value is converted into an instance of the specified type according to the casting from xs:string rules outlined in 17.1.1 Casting from xs:string and xs:untypedAtomic, XQuery 1.0 and XPath 2.0 Functions and Operators. If the cast fails an XQException is thrown.

Parameters
value- the lexical string value of the type
type- the item type
Returns
ZorbaXQItem representing the resulting item
Exceptions
XQException- if (1) any of the arguments are null, (2) given type is not an atomic type, (3) the conversion of the value to an XDM instance failed, or (4) the underlying object implementing the interface is closed

Definition at line 481 of file ZorbaXQConnection.java.

References org.zorbaxquery.api.xqj.ZorbaXQConnection.createItemFromString().

XQItem org.zorbaxquery.api.xqj.ZorbaXQConnection.createItemFromBoolean ( boolean  bln,
XQItemType  type 
) throws XQException
inline

Definition at line 1225 of file ZorbaXQConnection.java.

XQItem org.zorbaxquery.api.xqj.ZorbaXQConnection.createItemFromByte ( byte  b,
XQItemType  type 
) throws XQException
inline

Creates an item from a given value.

The value is converted into an instance of the specified type according to the rule defined in 14.2 Mapping a Java Data Type to an XQuery Data Type, XQuery API for Java (XQJ) 1.0. If the converstion fails, an XQException will be thrown.

Parameters
b- the value to be converted
type- the type of the value to be bound to the external variable. The default type of the value is used in case null is specified
Returns
ZorbaXQItem representing the resulting item
Exceptions
XQException- (1) the conversion of the value to an XDM instance failed, or (2) the underlying object implementing the interface is closed

Definition at line 1310 of file ZorbaXQConnection.java.

XQItem org.zorbaxquery.api.xqj.ZorbaXQConnection.createItemFromDocument ( String  value,
String  baseURI,
XQItemType  type 
) throws XQException
inline

Creates an item from the given value.

If the value represents a well-formed XML document, it will be parsed and results in a document node. The kind of the input type must be null, XQITEMKIND_DOCUMENT_ELEMENT, or XQITEMKIND_DOCUMENT_SCHEMA_ELEMENT.

The value is converted into an instance of the specified type according to the rules defined in 14.3 Mapping a Java XML document to an XQuery document node, XQuery API for Java (XQJ) 1.0.

If the value is not well formed, or if a kind of the input type other than the values list above is specified, behavior is implementation defined and may raise an exception.

Parameters
value- the value to be converted, cannot be null
baseURI- an optional base URI, can be null. It can be used, for example, to resolve relative URIs and to include in error messages.
type- the type of the value for the created document node. If null is specified, it behaves as if XQDataFactory.createDocumentElementType( XQDataFactory.createElementType(null, ZorbaXQItemType.XQBASETYPE_XS_UNTYPED)) were passed in as the type parameter. That is, the type represents the XQuery sequence type document-node(element(*, xs:untyped))
Returns
ZorbaXQItem representing the resulting item
Exceptions
XQException- if (1) the value argument is null, (2) the conversion of the value to an XDM instance failed, or (3) the underlying object implementing the interface is closed

Definition at line 666 of file ZorbaXQConnection.java.

References org.zorbaxquery.api.xqj.ZorbaXQConnection.createElementType().

Referenced by org.zorbaxquery.api.xqj.ZorbaXQConnection.createItemFromDocument().

XQItem org.zorbaxquery.api.xqj.ZorbaXQConnection.createItemFromDocument ( Reader  value,
String  baseURI,
XQItemType  type 
) throws XQException
inline

Creates an item from the given value.

If the value represents a well-formed XML document, it will be parsed and results in a document node. The kind of the input type must be null, XQITEMKIND_DOCUMENT_ELEMENT, or XQITEMKIND_DOCUMENT_SCHEMA_ELEMENT.

The value is converted into an instance of the specified type according to the rules defined in 14.3 Mapping a Java XML document to an XQuery document node, XQuery API for Java (XQJ) 1.0.

If the value is not well formed, or if a kind of the input type other than the values list above is specified, behavior is implementation defined and may raise an exception.

Parameters
value- the value to be converted, cannot be null
baseURI- an optional base URI, can be null. It can be used, for example, to resolve relative URIs and to include in error messages.
type- the type of the value for the created document node. If null is specified, it behaves as if XQDataFactory.createDocumentElementType( XQDataFactory.createElementType(null, ZorbaXQItemType.XQBASETYPE_XS_UNTYPED)) were passed in as the type parameter. That is, the type represents the XQuery sequence type document-node(element(*, xs:untyped))
Returns
ZorbaXQItem representing the resulting item
Exceptions
XQException- if (1) the value argument is null, (2) the conversion of the value to an XDM instance failed, or (3) the underlying object implementing the interface is closed

Definition at line 706 of file ZorbaXQConnection.java.

References org.zorbaxquery.api.xqj.ZorbaXQConnection.createElementType().

XQItem org.zorbaxquery.api.xqj.ZorbaXQConnection.createItemFromDocument ( InputStream  value,
String  baseURI,
XQItemType  type 
) throws XQException
inline

Creates an item from the given value.

If the value represents a well-formed XML document, it will be parsed and results in a document node. The kind of the input type must be null, XQITEMKIND_DOCUMENT_ELEMENT, or XQITEMKIND_DOCUMENT_SCHEMA_ELEMENT.

The value is converted into an instance of the specified type according to the rules defined in 14.3 Mapping a Java XML document to an XQuery document node, XQuery API for Java (XQJ) 1.0.

If the value is not well formed, or if a kind of the input type other than the values list above is specified, behavior is implementation defined and may raise an exception.

Parameters
value- the value to be converted, cannot be null
baseURI- an optional base URI, can be null. It can be used, for example, to resolve relative URIs and to include in error messages.
type- the type of the value for the created document node. If null is specified, it behaves as if XQDataFactory.createDocumentElementType( XQDataFactory.createElementType(null, ZorbaXQItemType.XQBASETYPE_XS_UNTYPED)) were passed in as the type parameter. That is, the type represents the XQuery sequence type document-node(element(*, xs:untyped))
Returns
ZorbaXQItem representing the resulting item
Exceptions
XQException- if (1) the value argument is null, (2) the conversion of the value to an XDM instance failed, or (3) the underlying object implementing the interface is closed

Definition at line 747 of file ZorbaXQConnection.java.

References org.zorbaxquery.api.xqj.ZorbaXQConnection.createElementType().

XQItem org.zorbaxquery.api.xqj.ZorbaXQConnection.createItemFromDocument ( XMLStreamReader  value,
XQItemType  type 
) throws XQException
inline

Creates an item from the given value.

If the value represents a well-formed XML document, it will be parsed and results in a document node. The kind of the input type must be null, XQITEMKIND_DOCUMENT_ELEMENT, or XQITEMKIND_DOCUMENT_SCHEMA_ELEMENT.

The value is converted into an instance of the specified type according to the rules defined in 14.3 Mapping a Java XML document to an XQuery document node, XQuery API for Java (XQJ) 1.0.

If the value is not well formed, or if a kind of the input type other than the values list above is specified, behavior is implementation defined and may raise an exception.

Parameters
value- the value to be converted, cannot be null
type- the type of the value for the created document node. If null is specified, it behaves as if XQDataFactory.createDocumentElementType( XQDataFactory.createElementType(null, ZorbaXQItemType.XQBASETYPE_XS_UNTYPED)) were passed in as the type parameter. That is, the type represents the XQuery sequence type document-node(element(*, xs:untyped))
Returns
ZorbaXQItem representing the resulting item
Exceptions
XQException- if (1) the value argument is null, (2) the conversion of the value to an XDM instance failed, or (3) the underlying object implementing the interface is closed

Definition at line 787 of file ZorbaXQConnection.java.

References org.zorbaxquery.api.xqj.ZorbaXQConnection.createItemFromDocument().

XQItem org.zorbaxquery.api.xqj.ZorbaXQConnection.createItemFromDocument ( Source  value,
XQItemType  type 
) throws XQException
inline

Creates an item from the given value.

An XQJ implementation must at least support the following implementations:

  • javax.xml.transform.dom.DOMSource
  • javax.xml.transform.sax.SAXSource
  • javax.xml.transform.stream.StreamSource

If the value represents a well-formed XML document, it will result in a document node. The kind of the input type must be null, XQITEMKIND_DOCUMENT_ELEMENT, or XQITEMKIND_DOCUMENT_SCHEMA_ELEMENT.

The value is converted into an instance of the specified type according to the rules defined in 14.3 Mapping a Java XML document to an XQuery document node, XQuery API for Java (XQJ) 1.0.

If the value is not well formed, or if a kind of the input type other than the values list above is specified, behavior is implementation defined and may raise an exception.

Parameters
value- the value to be converted, cannot be null
type- the type of the value for the created document node. If null is specified, it behaves as if XQDataFactory.createDocumentElementType( XQDataFactory.createElementType(null, ZorbaXQItemType.XQBASETYPE_XS_UNTYPED)) were passed in as the type parameter. That is, the type represents the XQuery sequence type document-node(element(*, xs:untyped))
Returns
ZorbaXQItem representing the resulting item
Exceptions
XQException- if (1) the value argument is null, (2) the conversion of the value to an XDM instance failed, or (3) the underlying object implementing the interface is closed

Definition at line 840 of file ZorbaXQConnection.java.

References org.zorbaxquery.api.xqj.ZorbaXQConnection.createItemFromDocument().

XQItem org.zorbaxquery.api.xqj.ZorbaXQConnection.createItemFromDouble ( double  value,
XQItemType  type 
) throws XQException
inline

Creates an item from a given value.

The value is converted into an instance of the specified type according to the rule defined in 14.2 Mapping a Java Data Type to an XQuery Data Type, XQuery API for Java (XQJ) 1.0. If the converstion fails, an XQException will be thrown.

Parameters
value- the value to be converted
type- the type of the value to be bound to the external variable. The default type of the value is used in case null is specified
Returns
ZorbaXQItem representing the resulting item
Exceptions
XQException- (1) the conversion of the value to an XDM instance failed, or (2) the underlying object implementing the interface is closed

Definition at line 1328 of file ZorbaXQConnection.java.

XQItem org.zorbaxquery.api.xqj.ZorbaXQConnection.createItemFromFloat ( float  value,
XQItemType  type 
) throws XQException
inline

Creates an item from a given value.

The value is converted into an instance of the specified type according to the rule defined in 14.2 Mapping a Java Data Type to an XQuery Data Type, XQuery API for Java (XQJ) 1.0. If the converstion fails, an XQException will be thrown.

Parameters
value- the value to be converted
type- the type of the value to be bound to the external variable. The default type of the value is used in case null is specified
Returns
ZorbaXQItem representing the resulting item
Exceptions
XQException- (1) the conversion of the value to an XDM instance failed, or (2) the underlying object implementing the interface is closed

Definition at line 1356 of file ZorbaXQConnection.java.

XQItem org.zorbaxquery.api.xqj.ZorbaXQConnection.createItemFromInt ( int  value,
XQItemType  type 
) throws XQException
inline

Creates an item from a given value.

The value is converted into an instance of the specified type according to the rule defined in 14.2 Mapping a Java Data Type to an XQuery Data Type, XQuery API for Java (XQJ) 1.0. If the converstion fails, an XQException will be thrown.

Parameters
value- the value to be converted
type- the type of the value to be bound to the external variable. The default type of the value is used in case null is specified
Returns
ZorbaXQItem representing the resulting item
Exceptions
XQException- (1) the conversion of the value to an XDM instance failed, or (2) the underlying object implementing the interface is closed

Definition at line 1384 of file ZorbaXQConnection.java.

XQItem org.zorbaxquery.api.xqj.ZorbaXQConnection.createItemFromLong ( long  value,
XQItemType  type 
) throws XQException
inline

Creates an item from a given value.

The value is converted into an instance of the specified type according to the rule defined in 14.2 Mapping a Java Data Type to an XQuery Data Type, XQuery API for Java (XQJ) 1.0. If the converstion fails, an XQException will be thrown.

Parameters
value- the value to be converted
type- the type of the value to be bound to the external variable. The default type of the value is used in case null is specified
Returns
ZorbaXQItem representing the resulting item
Exceptions
XQException- (1) the conversion of the value to an XDM instance failed, or (2) the underlying object implementing the interface is closed

Definition at line 1409 of file ZorbaXQConnection.java.

XQItem org.zorbaxquery.api.xqj.ZorbaXQConnection.createItemFromNode ( Node  value,
XQItemType  type 
) throws XQException
inline

Creates an item from a given value.

The value is converted into an instance of the specified type according to the rule defined in 14.2 Mapping a Java Data Type to an XQuery Data Type, XQuery API for Java (XQJ) 1.0. If the converstion fails, an XQException will be thrown.

Parameters
value- the value to be converted
type- the type of the value to be bound to the external variable. The default type of the value is used in case null is specified
Returns
ZorbaXQItem representing the resulting item
Exceptions
XQException- (1) the conversion of the value to an XDM instance failed, or (2) the underlying object implementing the interface is closed

Definition at line 1435 of file ZorbaXQConnection.java.

References org.zorbaxquery.api.xqj.ZorbaXQConnection.createItemFromString().

XQItem org.zorbaxquery.api.xqj.ZorbaXQConnection.createItemFromObject ( Object  value,
XQItemType  type 
) throws XQException
inline

Creates an item from a given value.

The value is converted into an instance of the specified type according to the rule defined in 14.2 Mapping a Java Data Type to an XQuery Data Type, XQuery API for Java (XQJ) 1.0. If the converstion fails, an XQException will be thrown.

Parameters
value- the value to be converted
type- the type of the value to be bound to the external variable. The default type of the value is used in case null is specified
Returns
ZorbaXQItem representing the resulting item
Exceptions
XQException- (1) the conversion of the value to an XDM instance failed, or (2) the underlying object implementing the interface is closed

Definition at line 867 of file ZorbaXQConnection.java.

XQItem org.zorbaxquery.api.xqj.ZorbaXQConnection.createItemFromShort ( short  value,
XQItemType  type 
) throws XQException
inline

Creates an item from a given value.

The value is converted into an instance of the specified type according to the rule defined in 14.2 Mapping a Java Data Type to an XQuery Data Type, XQuery API for Java (XQJ) 1.0. If the converstion fails, an XQException will be thrown.

Parameters
value- the value to be converted
type- the type of the value to be bound to the external variable. The default type of the value is used in case null is specified
Returns
ZorbaXQItem representing the resulting item
Exceptions
XQException- (1) the conversion of the value to an XDM instance failed, or (2) the underlying object implementing the interface is closed

Definition at line 1458 of file ZorbaXQConnection.java.

XQItem org.zorbaxquery.api.xqj.ZorbaXQConnection.createItemFromString ( String  value,
XQItemType  type 
) throws XQException
inline

Creates an item from a given value.

The value is converted into an instance of the specified type, which must represent an xs:string or a type derived by restriction from xs:string. If the specified type is null, it defaults to xs:string. Subsequently the value is converted into an instance of the specified type according to the rule defined in 14.2 Mapping a Java Data Type to an XQuery Data Type, XQuery API for Java (XQJ) 1.0. If the conversion fails, an XQException will be thrown.

Parameters
value- the value to be converted, cannot be null
type- the type of the value to be bound to the external variable. The default type, xs:string, is used in case null is specified
Returns
ZorbaXQItem representing the resulting item
Exceptions
XQException- if (1) the value argument is null, (2) the conversion of the value to an XDM instance failed, or (3) the underlying object implementing the interface is closed

Definition at line 508 of file ZorbaXQConnection.java.

Referenced by org.zorbaxquery.api.xqj.ZorbaXQConnection.createItemFromAtomicValue(), and org.zorbaxquery.api.xqj.ZorbaXQConnection.createItemFromNode().

XQItemType org.zorbaxquery.api.xqj.ZorbaXQConnection.createItemType ( ) throws XQException
inline

Creates a new ZorbaXQItemType object representing the XQuery item type.

The ZorbaXQItemType object will have the item kind set to ZorbaXQItemType.XQITEMKIND_ITEM.

Example -

ZorbaXQConnection conn = ..; // An XQuery connection
ZorbaXQItemType typ = conn.createItemType(); // represents the XQuery item type "item()"
Returns
a new ZorbaXQItemType representing the XQuery item type
Exceptions
XQException- if the underlying object implementing the interface is closed

Definition at line 1939 of file ZorbaXQConnection.java.

XQItemType org.zorbaxquery.api.xqj.ZorbaXQConnection.createNodeType ( ) throws XQException
inline

Creates a new ZorbaXQItemType object representing the XQuery node() type.

The ZorbaXQItemType object will have the item kind set to ZorbaXQItemType.XQITEMKIND_NODE.

Returns
a new ZorbaXQItemType representing the XQuery node() type
Exceptions
XQException- if the underlying object implementing the interface is closed

Definition at line 1953 of file ZorbaXQConnection.java.

XQItemType org.zorbaxquery.api.xqj.ZorbaXQConnection.createProcessingInstructionType ( String  piTarget) throws XQException
inline

Creates a new ZorbaXQItemType object representing the XQuery processing-instruction(piTarget) type.

The ZorbaXQItemType object will have the item kind set to ZorbaXQItemType.XQITEMKIND_PI. A string literal can be passed to match the PITarget of the processing instruction as described in 2.5.4.2 Matching an Item Type and an Item, XQuery 1.0: An XML Query Language.

Example -

ZorbaXQConnection conn = ..; // An XQuery connection
ZorbaXQItemType anypi = conn.createProcessingInstructionType();
ZorbaXQItemType foopi = conn.createProcessingInstructionType("foo-format");
ZorbaXQExpression expr = conn.createExpression();
ZorbaXQSequence result = expr.executeQuery("<?format role="output" ?>");
result.next();
boolean pi = result.instanceOf(anypi); // will be true
pi = result.instanceOf(foopi); // will be false
ZorbaXQExpression expr = conn.createExpression();
ZorbaXQSequence result = expr.executeQuery("<?foo-format role="output" ?>");
result.next();
boolean pi = result.instanceOf(anypi); // will be true
pi = result.instanceOf(foopi); // will be true
Parameters
piTarget- the string literal to match the processing instruction's PITarget. A null string value will match all processing instruction nodes
Returns
a new ZorbaXQItemType representing the XQuery processing-instruction(piTarget) type
Exceptions
XQException- if the underlying object implementing the interface is closed

Definition at line 1989 of file ZorbaXQConnection.java.

XQItemType org.zorbaxquery.api.xqj.ZorbaXQConnection.createSchemaAttributeType ( QName  nodename,
int  basetype,
URI  uri 
) throws XQException
inline

Creates a new ZorbaXQItemType object representing the XQuery schema-attribute(nodename,basetype,schemaURI) type, with the given node name, base type, and schema URI.

Example -

ZorbaXQConnection conn = ..; // An XQuery connection
- schema-attribute (name) // schema-attribute name, found in the schema
// available at http://customerschema.com
conn.createSchemaAttributeType(new QName("name"),
ZorbaXQItemType.XQBASETYPE_STRING,
new URI(http://customerschema.com));
Parameters
nodename- specifies the name of the node
basetype- the base type of the attribute. One of the XQItemTyupe.XQBASETYPE_* constants other than ZorbaXQItemType.XQBASETYPE_UNTYPED or ZorbaXQItemType.XQBASETYPE_ANYTYPE
uri- the URI to the schema. Can be null
Returns
a new ZorbaXQItemType representing the XQuery schema-attribute(nodename,basetype, schemaURI) type
Exceptions
XQException- if (1) the node name is null, (2) if the base type is one of: ZorbaXQItemType.XQBASETYPE_UNTYPED or ZorbaXQItemType.XQBASETYPE_ANYTYPE, (3) the underlying object implementing the interface is closed, or (4) the implementation does not support user-defined XML schema types

Definition at line 1716 of file ZorbaXQConnection.java.

XQItemType org.zorbaxquery.api.xqj.ZorbaXQConnection.createSchemaElementType ( QName  nodename,
int  baseType,
URI  schemaURI 
) throws XQException
inline

Creates a new ZorbaXQItemType object representing the XQuery schema-element(nodename,basetype,schemaURI) type, given the node name, base type, and the schema URI.

Example -

ZorbaXQConnection conn = ..; // An XQuery connection
- schema-element (customer) // schema-element person, found in
// the schema available at http://customerschema.com
conn.createElementType(new QName("customer"), ZorbaXQItemType.XQBASETYPE_ANYTYPE,
new URI("http://customerschema.com"));
Parameters
nodename- specifies the name of the element
baseType- the base type of the item. One of the ZorbaXQItemType.XQBASETYPE_* constants
schemaURI- the URI to the schema. Can be null
Returns
a new ZorbaXQItemType representing the XQuery schema-element(nodename,basetype, schemaURI) type
Exceptions
XQException- if (1) the node name is null, (2) the underlying object implementing the interface is closed, or (3) the implementation does not support user-defined XML schema types

Definition at line 1920 of file ZorbaXQConnection.java.

XQSequence org.zorbaxquery.api.xqj.ZorbaXQConnection.createSequence ( XQSequence  value) throws XQException
inline

Creates a copy of the specified ZorbaXQSequence.

Creates a copy of the specified ZorbaXQSequence. The newly created ZorbaXQSequence is scrollable and independent of any underlying ZorbaXQConnection. The new ZorbaXQSequence will contain all items from the specified ZorbaXQSequence starting from its current position. The copy process will implicitly perform next operations on the specified sequence to read the items. All items are consumed, the current position of the cursor is set to point after the last item.

Parameters
value- input sequence
Returns
ZorbaXQSequence representing a copy of the input sequence
Exceptions
XQException- if (1) there are errors accessing the items in the specified sequence, (2) the specified sequence is closed, (3) in the case of a forward only sequence, a get or write method has already been invoked on the current item, (4) the s parameter is null, or (5) the underlying object implementing the interface is closed

Definition at line 1497 of file ZorbaXQConnection.java.

XQSequence org.zorbaxquery.api.xqj.ZorbaXQConnection.createSequence ( Iterator  value) throws XQException
inline

Creates an ZorbaXQSequence, containing all the items from the iterator.

The newly created ZorbaXQSequence is scrollable and independent of any underlying ZorbaXQConnection. If the iterator returns an ZorbaXQItem, it is added to the sequence. If the iterator returns any other object, an item is added to the sequence following the rules from 14.2 Mapping a Java Data Type to an XQuery Data Type, XQuery API for Java (XQJ) 1.0. If the iterator does not return any items, then an empty sequence is created.

Parameters
value- input sequence
Returns
ZorbaXQSequence representing a copy of the input sequence
Exceptions
XQException- if (1) there are errors accessing the items in the specified sequence, (2) the specified sequence is closed, (3) in the case of a forward only sequence, a get or write method has already been invoked on the current item, (4) the s parameter is null, or (5) the underlying object implementing the interface is closed

Definition at line 1521 of file ZorbaXQConnection.java.

XQSequenceType org.zorbaxquery.api.xqj.ZorbaXQConnection.createSequenceType ( XQItemType  item,
int  occurence 
) throws XQException
inline

Creates a new sequence type from an item type and occurence indicator.

Parameters
item- the item type. This parameter must be null if the occurance is ZorbaXQSequenceType.OCC_EMPTY, and cannot be null for any other occurance indicator
occurence- The occurence of the item type, must be one of ZorbaXQSequenceType.OCC_ZERO_OR_ONE, ZorbaXQSequenceType.OCC_EXACTLY_ONE, ZorbaXQSequenceType.OCC_ZERO_OR_MORE, ZorbaXQSequenceType.OCC_ONE_OR_MORE, ZorbaXQSequenceType.OCC_EMPTY
Returns
a new ZorbaXQSequenceType representing the type of a sequence
Exceptions
XQException- if (1) the item is null and the occurance is not ZorbaXQSequenceType.OCC_EMPTY, (2) the item is not null and the occurance is ZorbaXQSequenceType.OCC_EMPTY, (3) the occurence is not one of: ZorbaXQSequenceType.OCC_ZERO_OR_ONE, ZorbaXQSequenceType.OCC_EXACTLY_ONE, ZorbaXQSequenceType.OCC_ZERO_OR_MORE, ZorbaXQSequenceType.OCC_ONE_OR_MORE, ZorbaXQSequenceType.OCC_EMPTY or (4) the underlying object implementing the interface is closed

Definition at line 2003 of file ZorbaXQConnection.java.

XQItemType org.zorbaxquery.api.xqj.ZorbaXQConnection.createTextType ( ) throws XQException
inline

Creates a new ZorbaXQItemType object representing the XQuery text() type.

The ZorbaXQItemType object will have the item kind set to ZorbaXQItemType.XQITEMKIND_TEXT.

Returns
a new ZorbaXQItemType representing the XQuery text() type
Exceptions
XQException- if the underlying object implementing the interface is closed

Definition at line 2028 of file ZorbaXQConnection.java.

boolean org.zorbaxquery.api.xqj.ZorbaXQConnection.getAutoCommit ( ) throws XQException
inline

Gets the auto-commit attribute of this connection.

Returns
the auto-commit attribute of this connection. true if the connection operates in auto-commit mode; otherwise false
Exceptions
XQException- if the connection is in a closed state

Definition at line 199 of file ZorbaXQConnection.java.

XQMetaData org.zorbaxquery.api.xqj.ZorbaXQConnection.getMetaData ( ) throws XQException
inline

Gets the metadata for this connection.

Returns
XQMetadata representing the metadata of this connection
Exceptions
XQException- if the connection is in a closed state

Definition at line 259 of file ZorbaXQConnection.java.

XQStaticContext org.zorbaxquery.api.xqj.ZorbaXQConnection.getStaticContext ( ) throws XQException
inline

Gets an ZorbaXQStaticContext representing the default values for all expression properties.

In order to modify the defaults, it is not sufficient to modify the values in the returned ZorbaXQStaticContext object; in addition setStaticContext should be called to make those new values effective.

Returns
ZorbaXQStaticContext representing the default values for all expression properties
Exceptions
XQException- if the connection is in a closed state

Definition at line 439 of file ZorbaXQConnection.java.

ZorbaXQXmlDataManager org.zorbaxquery.api.xqj.ZorbaXQConnection.getXmlDataManager ( )
inline

Definition at line 180 of file ZorbaXQConnection.java.

Zorba org.zorbaxquery.api.xqj.ZorbaXQConnection.getZorbaInstance ( ) throws XQException
inlineprotected

Definition at line 90 of file ZorbaXQConnection.java.

boolean org.zorbaxquery.api.xqj.ZorbaXQConnection.isClosed ( )
inline

Checks if the connection is closed.

Returns
true if the connection is in a closed state, false otherwise

Definition at line 269 of file ZorbaXQConnection.java.

XQPreparedExpression org.zorbaxquery.api.xqj.ZorbaXQConnection.prepareExpression ( String  value) throws XQException
inline

Prepares an expression for execution.

The properties of the connection's default ZorbaXQStaticContext are copied to the returned ZorbaXQPreparedExpression.

Parameters
value- the XQuery expression as a String. Cannot be null
Returns
the prepared XQuery expression
Exceptions
XQException- if (1) the connection is in a closed state, (2) there are errors preparing the expression, or (3) the xquery parameter is null

Definition at line 282 of file ZorbaXQConnection.java.

XQPreparedExpression org.zorbaxquery.api.xqj.ZorbaXQConnection.prepareExpression ( String  string,
XQStaticContext  xqsc 
) throws XQException
inline

Prepares an expression for execution.

The properties of the connection's default ZorbaXQStaticContext are copied to the returned ZorbaXQPreparedExpression.

Parameters
string- the XQuery expression as a String. Cannot be null
xqsc- ZorbaXQStaticContext containing values of expression properties.
Returns
the prepared XQuery expression
Exceptions
XQException- if (1) the connection is in a closed state, (2) there are errors preparing the expression, or (3) the xquery parameter is null

Definition at line 309 of file ZorbaXQConnection.java.

XQPreparedExpression org.zorbaxquery.api.xqj.ZorbaXQConnection.prepareExpression ( Reader  reader) throws XQException
inline

Prepares an expression for execution.

The properties of the connection's default ZorbaXQStaticContext are copied to the returned ZorbaXQPreparedExpression.

Parameters
reader- the XQuery expression as a Reader. Cannot be null
Returns
the prepared XQuery expression
Exceptions
XQException- if (1) the connection is in a closed state, (2) there are errors preparing the expression, or (3) the xquery parameter is null

Definition at line 332 of file ZorbaXQConnection.java.

XQPreparedExpression org.zorbaxquery.api.xqj.ZorbaXQConnection.prepareExpression ( Reader  reader,
XQStaticContext  xqsc 
) throws XQException
inline

Prepares an expression for execution.

The properties of the connection's default ZorbaXQStaticContext are copied to the returned ZorbaXQPreparedExpression.

Parameters
reader- the XQuery expression as a Reader. Cannot be null
xqsc- ZorbaXQStaticContext containing values of expression properties
Returns
the prepared XQuery expression
Exceptions
XQException- if (1) the connection is in a closed state, (2) there are errors preparing the expression, or (3) the xquery parameter is null

Definition at line 356 of file ZorbaXQConnection.java.

XQPreparedExpression org.zorbaxquery.api.xqj.ZorbaXQConnection.prepareExpression ( InputStream  in) throws XQException
inline

Prepares an expression for execution.

The properties of the connection's default ZorbaXQStaticContext are copied to the returned ZorbaXQPreparedExpression.

Parameters
in- the XQuery expression as an InputStream. Cannot be null
Returns
the prepared XQuery expression
Exceptions
XQException- if (1) the connection is in a closed state, (2) there are errors preparing the expression, or (3) the xquery parameter is null

Definition at line 376 of file ZorbaXQConnection.java.

XQPreparedExpression org.zorbaxquery.api.xqj.ZorbaXQConnection.prepareExpression ( InputStream  in,
XQStaticContext  xqsc 
) throws XQException
inline

Prepares an expression for execution.

The properties of the connection's default ZorbaXQStaticContext are copied to the returned ZorbaXQPreparedExpression.

Parameters
in- the XQuery expression as an InputStream. Cannot be null
xqsc- ZorbaXQStaticContext containing values of expression properties
Returns
the prepared XQuery expression
Exceptions
XQException- if (1) the connection is in a closed state, (2) there are errors preparing the expression, or (3) the xquery parameter is null

Definition at line 405 of file ZorbaXQConnection.java.

void org.zorbaxquery.api.xqj.ZorbaXQConnection.rollback ( ) throws XQException
inline

Undoes all changes made in the current transaction and releases any locks held by the datasource.

This method should be used only when auto-commit mode is disabled.

Exceptions
XQException- if the connection is in a closed state or this connection is operating in auto-commit mode

Definition at line 427 of file ZorbaXQConnection.java.

void org.zorbaxquery.api.xqj.ZorbaXQConnection.setAutoCommit ( boolean  bln) throws XQException
inline

Definition at line 188 of file ZorbaXQConnection.java.

void org.zorbaxquery.api.xqj.ZorbaXQConnection.setStaticContext ( XQStaticContext  xqsc) throws XQException
inline

Sets the default values for all expression properties.

The implementation will read out all expression properties from the specified ZorbaXQStaticContext and update its private copy.

Parameters
xqsc- ZorbaXQStaticContext containing values of expression properties
Exceptions
XQException- if the connection is in a closed state

Definition at line 462 of file ZorbaXQConnection.java.


The documentation for this class was generated from the following file: