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

This interface describes the execute immediate functionality for expressions. More...

Inherits XQExpression.

Public Member Functions

void bindAtomicValue (QName varName, String value, XQItemType type) throws XQException
 Binds a value to the given external variable or the context item. More...
 
void bindBoolean (QName varName, boolean value, XQItemType type) throws XQException
 Binds a value to the given external variable or the context item. More...
 
void bindByte (QName varName, byte value, XQItemType type) throws XQException
 Binds a value to the given external variable or the context item. More...
 
void bindDocument (QName varName, String value, String baseURI, XQItemType type) throws XQException
 Binds a value to the given external variable or the context item. More...
 
void bindDocument (QName varName, Reader value, String baseURI, XQItemType type) throws XQException
 Binds a value to the given external variable or the context item. More...
 
void bindDocument (QName varName, InputStream value, String baseURI, XQItemType type) throws XQException
 Binds a value to the given external variable or the context item. More...
 
void bindDocument (QName varName, XMLStreamReader value, XQItemType type) throws XQException
 Binds a value to the given external variable or the context item. More...
 
void bindDocument (QName varName, Source value, XQItemType type) throws XQException
 Binds a value to the given external variable or the context item. More...
 
void bindDouble (QName varName, double value, XQItemType type) throws XQException
 Binds a value to the given external variable or the context item. More...
 
void bindFloat (QName varName, float value, XQItemType type) throws XQException
 Binds a value to the given external variable or the context item. More...
 
void bindInt (QName varName, int value, XQItemType type) throws XQException
 Binds a value to the given external variable or the context item. More...
 
void bindItem (QName varName, XQItem value) throws XQException
 Binds a value to the given external variable. More...
 
void bindLong (QName varName, long value, XQItemType type) throws XQException
 Binds a value to the given external variable or the context item. More...
 
void bindNode (QName varName, Node value, XQItemType type) throws XQException
 Binds a value to the given external variable or the context item. More...
 
void bindObject (QName varName, Object value, XQItemType type) throws XQException
 Binds a value to the given external variable or the context item. More...
 
void bindSequence (QName varName, XQSequence value) throws XQException
 Binds a value to the given external variable. More...
 
void bindShort (QName varName, short value, XQItemType type) throws XQException
 Binds a value to the given external variable or the context item. More...
 
void bindString (QName varName, String value, XQItemType type) throws XQException
 Binds a value to the given external variable or the context item. More...
 
void cancel () throws XQException
 Attempts to cancel the execution if both the XQuery engine and XQJ driver support aborting the execution of an ZorbaXQExpression. More...
 
void close () throws XQException
 Closes the expression object and release associated resources. More...
 
void executeCommand (String string) throws XQException
 Executes an implementation-defined command. More...
 
void executeCommand (Reader reader) throws XQException
 Executes an implementation-defined command. More...
 
XQResultSequence executeQuery (String value) throws XQException
 Executes a query expression. More...
 
XQResultSequence executeQuery (Reader value) throws XQException
 Executes a query expression. More...
 
XQResultSequence executeQuery (InputStream value) throws XQException
 Executes a query expression. More...
 
TimeZone getImplicitTimeZone () throws XQException
 Gets the implicit timezone. More...
 
XQStaticContext getStaticContext () throws XQException
 Gets an ZorbaXQStaticContext representing the values for all expression properties. More...
 
boolean isClosed ()
 Checks if the expression is in a closed state. More...
 
void setImplicitTimeZone (TimeZone value) throws XQException
 Sets the implicit timezone. More...
 
 ZorbaXQExpression (XQConnection conn) throws XQException
 
 ZorbaXQExpression (XQConnection conn, XQStaticContext sc) throws XQException
 

Detailed Description

This interface describes the execute immediate functionality for expressions.

This object can be created from the ZorbaXQConnection and the execution can be done using the executeQuery() or executeCommand() method, passing in the XQuery expression.

All external variables defined in the prolog of the expression to be executed must be set in the dynamic context of this expression using the bind methods. Also, variables bound in this expression but not defined as external in the prolog of the expression to be executed, are simply ignored. For example, if variables $var1 and $var2 are bound, but the query only defines $var1 as external, no error will be reported for the binding of $var2. It will simply be ignored. When the expression is executed using the executeQuery method, if the execution is successful, then an ZorbaXQResultSequence object is returned. The ZorbaXQResultSequence object is tied to the ZorbaXQExpression from which it was prepared and is closed implicitly if that ZorbaXQExpression is either closed or re-executed.

The ZorbaXQExpression object is dependent on the ZorbaXQConnection object from which it was created and is only valid for the duration of that object. Thus, if the ZorbaXQConnection object is closed then this ZorbaXQExpression object will be implicitly closed and it can no longer be used.

An XQJ driver is not required to provide finalizer methods for the connection and other objects. Hence it is strongly recommended that users call close 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. Not closing this object implicitly or explicitly might result in serious memory leaks.

When the ZorbaXQExpression is closed any ZorbaXQResultSequence object obtained from it is also implicitly closed.

Example -

ZorbaXQConnection conn = XQDatasource.getConnection();
ZorbaXQExpression expr = conn.createExpression();
expr.bindInt(new QName("x"), 21, null);
XQSequence result = expr.executeQuery(
"declare variable $x as xs:integer external;
for $i in $x return $i");
while (result.next())
{
// process results ...
}
// Execute some other expression on the same object
XQSequence result = expr.executeQuery("for $i in doc('foo.xml') return $i");
...
result.close(); // close the result
expr.close();
conn.close();

Definition at line 69 of file ZorbaXQExpression.java.

Constructor & Destructor Documentation

org.zorbaxquery.api.xqj.ZorbaXQExpression.ZorbaXQExpression ( XQConnection  conn) throws XQException
inline

Definition at line 80 of file ZorbaXQExpression.java.

org.zorbaxquery.api.xqj.ZorbaXQExpression.ZorbaXQExpression ( XQConnection  conn,
XQStaticContext  sc 
) throws XQException
inline

Definition at line 87 of file ZorbaXQExpression.java.

Member Function Documentation

void org.zorbaxquery.api.xqj.ZorbaXQExpression.bindAtomicValue ( QName  varName,
String  value,
XQItemType  type 
) throws XQException
inline

Binds a value to the given external variable or the context item.

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, or if there is a mismatch between the static and dynamic types, an XQException is thrown either by this method or during query evaluation.

Parameters
varName- the name of the external variable to bind to
value- the lexical string value of the type
type- the item type of the bind
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, (4) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (5) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (6) the expression is in a closed state

Definition at line 299 of file ZorbaXQExpression.java.

void org.zorbaxquery.api.xqj.ZorbaXQExpression.bindBoolean ( QName  varName,
boolean  value,
XQItemType  type 
) throws XQException
inline

Binds a value to the given external variable or the context item.

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, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation.

Parameters
varName- the name of the external variable to bind to, cannot be null
value- the value to be bound, cannot be null
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
Exceptions
XQException- if (1) the varName or value argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state

Definition at line 566 of file ZorbaXQExpression.java.

void org.zorbaxquery.api.xqj.ZorbaXQExpression.bindByte ( QName  varName,
byte  value,
XQItemType  type 
) throws XQException
inline

Binds a value to the given external variable or the context item.

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, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation.

Parameters
varName- the name of the external variable to bind to, cannot be null
value- the value to be bound, cannot be null
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
Exceptions
XQException- if (1) the varName or value argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state

Definition at line 587 of file ZorbaXQExpression.java.

void org.zorbaxquery.api.xqj.ZorbaXQExpression.bindDocument ( QName  varName,
String  value,
String  baseURI,
XQItemType  type 
) throws XQException
inline

Binds a value to the given external variable or the context item.

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 conversion fails, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation. 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
varName- the name of the external variable to bind to, cannot be null
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, XQItemType.XQBASETYPE_XS_UNTYPED)) were passed in as the type parameter. That is, the type represents the XQuery sequence type document-node(element(*, xs:untyped))
Exceptions
XQException- if (1) the varName or value argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state

Definition at line 349 of file ZorbaXQExpression.java.

void org.zorbaxquery.api.xqj.ZorbaXQExpression.bindDocument ( QName  varName,
Reader  value,
String  baseURI,
XQItemType  type 
) throws XQException
inline

Binds a value to the given external variable or the context item.

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 conversion fails, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation. 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
varName- the name of the external variable to bind to, cannot be null
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, XQItemType.XQBASETYPE_XS_UNTYPED)) were passed in as the type parameter. That is, the type represents the XQuery sequence type document-node(element(*, xs:untyped))
Exceptions
XQException- if (1) the varName or value argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state

Definition at line 376 of file ZorbaXQExpression.java.

void org.zorbaxquery.api.xqj.ZorbaXQExpression.bindDocument ( QName  varName,
InputStream  value,
String  baseURI,
XQItemType  type 
) throws XQException
inline

Binds a value to the given external variable or the context item.

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 conversion fails, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation. 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
varName- the name of the external variable to bind to, cannot be null
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, XQItemType.XQBASETYPE_XS_UNTYPED)) were passed in as the type parameter. That is, the type represents the XQuery sequence type document-node(element(*, xs:untyped))
Exceptions
XQException- if (1) the varName or value argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state

Definition at line 403 of file ZorbaXQExpression.java.

void org.zorbaxquery.api.xqj.ZorbaXQExpression.bindDocument ( QName  varName,
XMLStreamReader  value,
XQItemType  type 
) throws XQException
inline

Binds a value to the given external variable or the context item.

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 conversion fails, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation. 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
varName- the name of the external variable to bind to, cannot be null
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, XQItemType.XQBASETYPE_XS_UNTYPED)) were passed in as the type parameter. That is, the type represents the XQuery sequence type document-node(element(*, xs:untyped))
Exceptions
XQException- if (1) the varName or value argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state

Definition at line 429 of file ZorbaXQExpression.java.

void org.zorbaxquery.api.xqj.ZorbaXQExpression.bindDocument ( QName  varName,
Source  value,
XQItemType  type 
) throws XQException
inline

Binds a value to the given external variable or the context item.

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 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 conversion fails, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation. 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
varName- the name of the external variable to bind to, cannot be null
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, XQItemType.XQBASETYPE_XS_UNTYPED)) were passed in as the type parameter. That is, the type represents the XQuery sequence type document-node(element(*, xs:untyped))
Exceptions
XQException- if (1) the varName or value argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state

Definition at line 460 of file ZorbaXQExpression.java.

void org.zorbaxquery.api.xqj.ZorbaXQExpression.bindDouble ( QName  varName,
double  value,
XQItemType  type 
) throws XQException
inline

Binds a value to the given external variable or the context item.

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, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation.

Parameters
varName- the name of the external variable to bind to, cannot be null
value- the value to be bound, cannot be null
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
Exceptions
XQException- if (1) the varName or value argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state

Definition at line 608 of file ZorbaXQExpression.java.

void org.zorbaxquery.api.xqj.ZorbaXQExpression.bindFloat ( QName  varName,
float  value,
XQItemType  type 
) throws XQException
inline

Binds a value to the given external variable or the context item.

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, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation.

Parameters
varName- the name of the external variable to bind to, cannot be null
value- the value to be bound, cannot be null
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
Exceptions
XQException- if (1) the varName or value argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state

Definition at line 629 of file ZorbaXQExpression.java.

void org.zorbaxquery.api.xqj.ZorbaXQExpression.bindInt ( QName  varName,
int  value,
XQItemType  type 
) throws XQException
inline

Binds a value to the given external variable or the context item.

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, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation.

Parameters
varName- the name of the external variable to bind to, cannot be null
value- the value to be bound, cannot be null
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
Exceptions
XQException- if (1) the varName or value argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state

Definition at line 650 of file ZorbaXQExpression.java.

void org.zorbaxquery.api.xqj.ZorbaXQExpression.bindItem ( QName  varName,
XQItem  value 
) throws XQException
inline

Binds a value to the given external variable.

The dynamic type of the value is derived from the ZorbaXQItem. In case of a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation.

Parameters
varName- the name of the external variable to bind to, cannot be null
value- the value to be bound, cannot be null
Exceptions
XQException- if (1) any of the arguments are null, (2) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (3) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, (4) the expression is in a closed state, or (5) the specified item is closed

Definition at line 497 of file ZorbaXQExpression.java.

void org.zorbaxquery.api.xqj.ZorbaXQExpression.bindLong ( QName  varName,
long  value,
XQItemType  type 
) throws XQException
inline

Binds a value to the given external variable or the context item.

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, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation.

Parameters
varName- the name of the external variable to bind to, cannot be null
value- the value to be bound, cannot be null
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
Exceptions
XQException- if (1) the varName or value argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state

Definition at line 671 of file ZorbaXQExpression.java.

void org.zorbaxquery.api.xqj.ZorbaXQExpression.bindNode ( QName  varName,
Node  value,
XQItemType  type 
) throws XQException
inline

Binds a value to the given external variable or the context item.

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, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation.

Parameters
varName- the name of the external variable to bind to, cannot be null
value- the value to be bound, cannot be null
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
Exceptions
XQException- if (1) the varName or value argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state

Definition at line 692 of file ZorbaXQExpression.java.

void org.zorbaxquery.api.xqj.ZorbaXQExpression.bindObject ( QName  varName,
Object  value,
XQItemType  type 
) throws XQException
inline

Binds a value to the given external variable or the context item.

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, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation.

Parameters
varName- the name of the external variable to bind to, cannot be null
value- the value to be bound, cannot be null
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
Exceptions
XQException- if (1) the varName or value argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state

Definition at line 539 of file ZorbaXQExpression.java.

void org.zorbaxquery.api.xqj.ZorbaXQExpression.bindSequence ( QName  varName,
XQSequence  value 
) throws XQException
inline

Binds a value to the given external variable.

The input sequence is consumed from its current position to the end, after which the input sequence's position will be set to point after the last item. The dynamic type of the value is derived from the items in the sequence. In case of a mismatch between the static and dynamic types, an XQException is be raised either by this method, or during query evaluation.

Parameters
varName- the name of the external variable to bind to, cannot be null
value- the value to be bound, cannot be null
Exceptions
XQException- if (1) any of the arguments are null, (2) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (3) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, (4) the expression is in a closed state, or (5) the specified item is closed

Definition at line 517 of file ZorbaXQExpression.java.

void org.zorbaxquery.api.xqj.ZorbaXQExpression.bindShort ( QName  varName,
short  value,
XQItemType  type 
) throws XQException
inline

Binds a value to the given external variable or the context item.

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, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation.

Parameters
varName- the name of the external variable to bind to, cannot be null
value- the value to be bound, cannot be null
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
Exceptions
XQException- if (1) the varName or value argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state

Definition at line 714 of file ZorbaXQExpression.java.

void org.zorbaxquery.api.xqj.ZorbaXQExpression.bindString ( QName  varName,
String  value,
XQItemType  type 
) throws XQException
inline

Binds a value to the given external variable or the context item.

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, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation.

Parameters
varName- the name of the external variable to bind to, cannot be null
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
Exceptions
XQException- if (1) the varName or value argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state

Definition at line 322 of file ZorbaXQExpression.java.

void org.zorbaxquery.api.xqj.ZorbaXQExpression.cancel ( ) throws XQException
inline

Attempts to cancel the execution if both the XQuery engine and XQJ driver support aborting the execution of an ZorbaXQExpression.

This method can be used by one thread to cancel an ZorbaXQExpression, that is being executed in another thread. If cancellation is not supported or the attempt to cancel the execution was not successful, the method returns without any error. If the cancellation is successful, an XQException is thrown, to indicate that it has been aborted, by executeQuery, executeCommand or any method accessing the ZorbaXQResultSequence returned by executeQuery. If applicable, any open ZorbaXQResultSequence and XQResultItem objects will also be implicitly closed in this case.

Exceptions
XQException- if the expression is in a closed state

Definition at line 102 of file ZorbaXQExpression.java.

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

Closes the expression object and release associated resources.

Once the expression is closed, all methods on this object other than the close or isClosed will raise exceptions. This also closes any result sequences obtained from this expression. Calling close on an ZorbaXQExpression object that is already closed has no effect.

Exceptions
XQException- if there are errors when closing the expression

Definition at line 124 of file ZorbaXQExpression.java.

void org.zorbaxquery.api.xqj.ZorbaXQExpression.executeCommand ( String  string) throws XQException
inline

Executes an implementation-defined command.

Calling this method implicitly closes any previous result sequence obtained from this expression.

Parameters
string- the input command as a string
Exceptions
XQException- if (1) there are errors when executing the command, or (2) the expression is in a closed state

Definition at line 139 of file ZorbaXQExpression.java.

void org.zorbaxquery.api.xqj.ZorbaXQExpression.executeCommand ( Reader  reader) throws XQException
inline

Executes an implementation-defined command.

Calling this method implicitly closes any previous result sequence obtained from this expression.

Parameters
reader- the input command as a reader
Exceptions
XQException- if (1) there are errors when executing the command, or (2) the expression is in a closed state

Definition at line 151 of file ZorbaXQExpression.java.

XQResultSequence org.zorbaxquery.api.xqj.ZorbaXQExpression.executeQuery ( String  value) throws XQException
inline

Executes a query expression.

This implicitly closes any previous result sequences obtained from this expression.

Parameters
value- the input query expression string. Cannot be null
Returns
an ZorbaXQResultSequence object containing the result of the query execution
Exceptions
XQException- if (1) there are errors when executing the query, (2) the expression is in a closed state, (3) the execution is cancelled, (4) the query parameter is null

Definition at line 164 of file ZorbaXQExpression.java.

Referenced by org.zorbaxquery.api.xqj.ZorbaXQExpression.executeQuery().

XQResultSequence org.zorbaxquery.api.xqj.ZorbaXQExpression.executeQuery ( Reader  value) throws XQException
inline

Executes a query expression.

This implicitly closes any previous result sequences obtained from this expression.

Parameters
value- the input query expression reader object. Cannot be null
Returns
an ZorbaXQResultSequence object containing the result of the query execution
Exceptions
XQException- if (1) there are errors when executing the query, (2) the expression is in a closed state, (3) the execution is cancelled, (4) the query parameter is null

Definition at line 208 of file ZorbaXQExpression.java.

References org.zorbaxquery.api.xqj.ZorbaXQExpression.executeQuery().

XQResultSequence org.zorbaxquery.api.xqj.ZorbaXQExpression.executeQuery ( InputStream  value) throws XQException
inline

Executes a query expression.

This implicitly closes any previous result sequences obtained from this expression.

Parameters
value- the input query expression inputstream object. Cannot be null
Returns
an ZorbaXQResultSequence object containing the result of the query execution
Exceptions
XQException- if (1) there are errors when executing the query, (2) the expression is in a closed state, (3) the execution is cancelled, (4) the query parameter is null

Definition at line 239 of file ZorbaXQExpression.java.

References org.zorbaxquery.api.xqj.ZorbaXQExpression.executeQuery().

TimeZone org.zorbaxquery.api.xqj.ZorbaXQExpression.getImplicitTimeZone ( ) throws XQException
inline

Gets the implicit timezone.

Returns
the implicit timezone. This may have been set by an application using the setImplicitTimeZone method or provided by the implementation
Exceptions
XQException- if the expression is in a closed state

Definition at line 277 of file ZorbaXQExpression.java.

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

Gets an ZorbaXQStaticContext representing the values for all expression properties.

Note that these properties cannot be changed; in order to change, a new ZorbaXQExpression needs to be created.

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

Definition at line 262 of file ZorbaXQExpression.java.

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

Checks if the expression is in a closed state.

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

Definition at line 112 of file ZorbaXQExpression.java.

void org.zorbaxquery.api.xqj.ZorbaXQExpression.setImplicitTimeZone ( TimeZone  value) throws XQException
inline

Sets the implicit timezone.

Parameters
value- time zone to be set
Exceptions
XQException- if the expression is in a closed state

Definition at line 478 of file ZorbaXQExpression.java.


The documentation for this class was generated from the following file:
blog comments powered by Disqus