16 package org.zorbaxquery.api.xqj;
19 import java.nio.CharBuffer;
20 import java.util.ArrayList;
21 import java.util.Collection;
22 import java.util.TimeZone;
23 import javax.xml.namespace.QName;
24 import javax.xml.stream.XMLOutputFactory;
25 import javax.xml.stream.XMLStreamReader;
26 import javax.xml.stream.XMLStreamWriter;
27 import javax.xml.transform.*;
28 import javax.xml.transform.dom.DOMSource;
29 import javax.xml.transform.sax.SAXSource;
30 import javax.xml.transform.stax.StAXResult;
31 import javax.xml.transform.stax.StAXSource;
32 import javax.xml.transform.stream.StreamResult;
33 import javax.xml.transform.stream.StreamSource;
34 import javax.xml.xquery.*;
35 import org.w3c.dom.Node;
36 import org.zorbaxquery.api.*;
87 private XQConnection connection;
88 private boolean closed;
89 private Collection<XQResultSequence> resultSequences =
new ArrayList<XQResultSequence>();
90 private DynamicContext dynamicContext;
91 private XmlDataManager xmlDataManager;
92 private XQStaticContext staticContext;
93 private Collection<String> itemsBounded =
new ArrayList<String>();
97 if (conn.isClosed()) {
98 throw new XQException (
"Connection is closed");
104 query = zorba.compileQuery(string);
105 dynamicContext = query.getDynamicContext();
107 }
catch (Exception e) {
108 throw new XQException (
"Error creating new Prepared expression with static context: " + e.getLocalizedMessage());
114 if (conn.isClosed()) {
115 throw new XQException (
"Connection is closed");
121 ZorbaReaderWrapper stream =
new ZorbaReaderWrapper(reader);
122 query = zorba.compileQuery(stream);
123 dynamicContext = query.getDynamicContext();
125 }
catch (Exception e) {
126 throw new XQException (
"Error creating new Prepared expression with static context: " + e.getLocalizedMessage());
132 if (conn.isClosed()) {
133 throw new XQException (
"Connection is closed");
139 ZorbaInputWrapper stream =
new ZorbaInputWrapper(input);
140 query = zorba.compileQuery(stream);
141 dynamicContext = query.getDynamicContext();
143 }
catch (Exception e) {
144 throw new XQException (
"Error creating new Prepared expression with static context: " + e.getLocalizedMessage());
150 if (conn.isClosed()) {
151 throw new XQException (
"Connection is closed");
158 dynamicContext = query.getDynamicContext();
160 }
catch (Exception e) {
161 throw new XQException (
"Error creating new Prepared expression with static context: " + e.getLocalizedMessage());
167 if (conn.isClosed()) {
168 throw new XQException (
"Connection is closed");
174 ZorbaReaderWrapper stream =
new ZorbaReaderWrapper(reader);
176 dynamicContext = query.getDynamicContext();
178 }
catch (Exception e) {
179 throw new XQException (
"Error creating new Prepared expression with static context: " + e.getLocalizedMessage());
185 if (conn.isClosed()) {
186 throw new XQException (
"Connection is closed");
192 ZorbaInputWrapper stream =
new ZorbaInputWrapper(input);
194 dynamicContext = query.getDynamicContext();
196 }
catch (Exception e) {
197 throw new XQException (
"Error creating new Prepared expression with static context: " + e.getLocalizedMessage());
209 public void cancel() throws XQException {
210 isClosedXQException();
229 public void close() throws XQException {
231 for (XQResultSequence sequence: resultSequences) {
248 isClosedXQException();
249 XQResultSequence result = null;
252 }
catch (Exception e) {
253 throw new XQException(
"Error executing query: " + e.getLocalizedMessage());
255 resultSequences.add(result);
266 isClosedXQException();
267 Collection<QName> result =
new ArrayList<QName>();
268 Iterator iter =
new Iterator();
269 query.getExternalVariables(iter);
271 Item item =
new Item();
272 while (iter.next(item)) {
273 result.add(
new QName(item.getNamespace(), item.getLocalName(), item.getPrefix()));
277 return result.toArray(
new QName[0]);
280 private boolean isExternal(String varName) {
282 Iterator iter =
new Iterator();
283 query.getExternalVariables(iter);
285 Item item =
new Item();
286 while (iter.next(item)) {
287 if (item.getLocalName().equalsIgnoreCase(varName)) {
305 isClosedXQException();
307 Collection<QName> result =
new ArrayList<QName>();
308 Iterator iter =
new Iterator();
309 query.getExternalVariables(iter);
310 Item item =
new Item();
312 while (iter.next(item)) {
313 boolean found =
false;
314 for (String key: itemsBounded){
315 if (item.getLocalName().equalsIgnoreCase(key)) {
320 result.add(
new QName(item.getNamespace(), item.getLocalName(), item.getPrefix()));
325 return result.toArray(
new QName[0]);
337 isClosedXQException();
350 isClosedXQException();
351 isNullXQException(varName);
352 XQSequenceType result = null;
353 Iterator iter =
new Iterator();
354 query.getExternalVariables(iter);
356 Item item =
new Item();
357 while (iter.next(item)) {
358 if ( item.getLocalName().equalsIgnoreCase(varName.getLocalPart()) &&
359 item.getNamespace().equalsIgnoreCase(varName.getNamespaceURI()) &&
360 item.getPrefix().equalsIgnoreCase(varName.getPrefix()) ) {
361 if (item.getType().getStringValue().equals(
"xs:QName")) {
372 throw new XQException(
"Item not found");
386 isClosedXQException();
387 if (staticContext==null) {
390 return staticContext;
400 isClosedXQException();
401 Integer timeZone = (dynamicContext.getImplicitTimezone()/60);
402 TimeZone result = TimeZone.getTimeZone(
"GMT"+timeZone.toString());
416 public void bindAtomicValue(QName varName, String value, XQItemType type)
throws XQException {
417 isClosedXQException();
418 isNullXQException(varName);
419 isNullXQException(value);
420 isNullXQException(type);
421 if (!isExternal(varName.getLocalPart())) {
422 throw new XQException (
"The bound variable must be declared external in the prepared expression.");
424 if (type.getItemKind()!=XQItemType.XQITEMKIND_ATOMIC) {
425 throw new XQException (
"Item kind is not atomic.");
428 XQItem xqitem = connection.createItemFromAtomicValue(value, type);
429 Item item = ((org.zorbaxquery.api.xqj.ZorbaXQItem)xqitem).getZorbaItem();
430 dynamicContext.setVariable(varName.getLocalPart(), item);
431 itemsBounded.add(varName.getLocalPart());
432 }
catch (Exception e) {
433 throw new XQException (
"Error binding the atomic value: " + e.getLocalizedMessage());
449 public void bindString(QName varName, String value, XQItemType type)
throws XQException {
450 isClosedXQException();
451 isNullXQException(varName);
452 if (!isExternal(varName.getLocalPart())) {
453 throw new XQException (
"The bound variable must be declared external in the prepared expression.");
455 isNullXQException(value);
460 Iterator iter =
new Iterator();
461 boolean found =
false;
462 query.getExternalVariables(iter);
463 Item tmpItem =
new Item();
465 while (iter.next(tmpItem)) {
466 if (tmpItem.getStringValue().equalsIgnoreCase(varName.getLocalPart())) {
467 XQItem item = connection.createItemFromString(value, type);
468 dynamicContext.setVariable(varName.getLocalPart(), ((org.zorbaxquery.api.xqj.ZorbaXQItem)item).getZorbaItem());
469 itemsBounded.add(varName.getLocalPart());
476 throw new XQException (
"The variable: " + varName.getLocalPart() +
" doesn't exist.");
478 }
catch (XQException e) {
480 }
catch (Exception e) {
481 throw new XQException (
"Error binding string to the defined type: " + e.getLocalizedMessage());
501 public void bindDocument(QName varName, String value, String baseURI, XQItemType type)
throws XQException {
502 isClosedXQException();
503 isNullXQException(varName);
504 if (!isExternal(varName.getLocalPart())) {
505 throw new XQException (
"The bound variable must be declared external in the prepared expression.");
507 isNullXQException(value);
508 if (!((type==null) || (type.getItemKind()==XQItemType.XQITEMKIND_DOCUMENT_ELEMENT) || (type.getItemKind()==XQItemType.XQITEMKIND_DOCUMENT_SCHEMA_ELEMENT))) {
509 throw new XQException (
"Invalid type.");
512 type = connection.createDocumentElementType(connection.createElementType(null, XQItemType.XQBASETYPE_UNTYPED));
514 if (!isExternal(varName.getLocalPart())) {
515 throw new XQException (
"Variable not found in context.");
518 Item item =
new Item();
519 item = xmlDataManager.parseXMLtoItem(value);
520 dynamicContext.setVariable(varName.getLocalPart(), item);
521 itemsBounded.add(varName.getLocalPart());
522 }
catch (Exception e) {
523 throw new XQException (
"Error binding document: " + e.getLocalizedMessage());
543 public void bindDocument(QName varName, Reader value, String baseURI, XQItemType type)
throws XQException {
544 isClosedXQException();
545 isNullXQException(varName);
546 if (!isExternal(varName.getLocalPart())) {
547 throw new XQException (
"The bound variable must be declared external in the prepared expression.");
549 isNullXQException(value);
550 if (!((type==null) || (type.getItemKind()==XQItemType.XQITEMKIND_DOCUMENT_ELEMENT) || (type.getItemKind()==XQItemType.XQITEMKIND_DOCUMENT_SCHEMA_ELEMENT))) {
551 throw new XQException (
"Invalid type.");
554 type = connection.createDocumentElementType(connection.createElementType(null, XQItemType.XQBASETYPE_UNTYPED));
556 StringBuffer
string =
new StringBuffer();
557 CharBuffer buffer = CharBuffer.allocate(1024);
558 Writer writer =
new StringWriter();
561 while( value.read(buffer) >= 0 ) {
563 writer.append(buffer);
567 }
catch (Exception ex) {
568 throw new XQException(
"Error preparing expression" + ex.getLocalizedMessage());
571 bindDocument(varName, writer.toString(), baseURI, type);
589 public void bindDocument(QName varName, InputStream value, String baseURI, XQItemType type)
throws XQException {
590 isClosedXQException();
591 isNullXQException(varName);
592 if (!isExternal(varName.getLocalPart())) {
593 throw new XQException (
"The bound variable must be declared external in the prepared expression.");
595 isNullXQException(value);
596 if (!((type==null) || (type.getItemKind()==XQItemType.XQITEMKIND_DOCUMENT_ELEMENT) || (type.getItemKind()==XQItemType.XQITEMKIND_DOCUMENT_SCHEMA_ELEMENT))) {
597 throw new XQException (
"Invalid type.");
600 type = connection.createDocumentElementType(connection.createElementType(null, XQItemType.XQBASETYPE_UNTYPED));
602 StringBuffer out =
new StringBuffer ();
604 byte[] b =
new byte[4096];
605 for (
int n; (n = value.read(b)) != -1;) {
606 out.append(
new String(b, 0, n));
608 }
catch (Exception ex) {
609 throw new XQException(
"Error preparing expression" + ex.getLocalizedMessage());
628 public void bindDocument(QName varName, XMLStreamReader value, XQItemType type)
throws XQException {
629 isClosedXQException();
630 isNullXQException(varName);
631 if (!isExternal(varName.getLocalPart())) {
632 throw new XQException (
"The bound variable must be declared external in the prepared expression.");
634 isNullXQException(value);
635 if (!((type==null) || (type.getItemKind()==XQItemType.XQITEMKIND_DOCUMENT_ELEMENT) || (type.getItemKind()==XQItemType.XQITEMKIND_DOCUMENT_SCHEMA_ELEMENT))) {
636 throw new XQException (
"Invalid type.");
639 type = connection.createDocumentElementType(connection.createElementType(null, XQItemType.XQBASETYPE_UNTYPED));
642 TransformerFactory tf = TransformerFactory.newInstance();
646 XMLOutputFactory xof = XMLOutputFactory.newInstance();
647 Writer writer =
new StringWriter();
649 XMLStreamWriter xmlStreamWriter = xof.createXMLStreamWriter(writer);
650 t = tf.newTransformer();
651 source =
new StAXSource(value);
652 result =
new StAXResult(xmlStreamWriter);
653 t.transform(source, result);
654 }
catch (Exception ex) {
655 throw new XQException(
"Error transforming xml expression" + ex.getLocalizedMessage());
660 private String nodeToString(Node node) {
661 StringWriter sw =
new StringWriter();
663 Transformer t = TransformerFactory.newInstance().newTransformer();
664 t.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION,
"yes");
665 t.transform(
new DOMSource(node),
new StreamResult(sw));
666 }
catch (TransformerException te) {
667 System.out.println(
"nodeToString Transformer Exception" + te.getLocalizedMessage());
669 return sw.toString();
691 public void bindDocument(QName varName, Source value, XQItemType type)
throws XQException {
692 isClosedXQException();
693 isNullXQException(varName);
694 isNullXQException(value);
695 if (!((type==null) || (type.getItemKind()==XQItemType.XQITEMKIND_DOCUMENT_ELEMENT) || (type.getItemKind()==XQItemType.XQITEMKIND_DOCUMENT_SCHEMA_ELEMENT))) {
696 throw new XQException (
"Invalid type.");
698 if (!isExternal(varName.getLocalPart())) {
699 throw new XQException (
"The bound variable must be declared external in the prepared expression.");
702 type = connection.createDocumentElementType(connection.createElementType(null, XQItemType.XQBASETYPE_UNTYPED));
704 if (value instanceof StreamSource) {
705 bindDocument(varName, ((StreamSource)value).getReader(), null, type);
706 }
else if (value instanceof SAXSource) {
707 bindDocument(varName, ((SAXSource)value).getInputSource().getCharacterStream(), null, type);
708 }
else if (value instanceof DOMSource) {
709 bindDocument(varName, nodeToString(((DOMSource)value).getNode()), null, type);
711 throw new UnsupportedOperationException(
"Not supported yet.");
722 isClosedXQException();
723 isNullXQException(value);
725 dynamicContext.setImplicitTimezone((value.getRawOffset()/60000));
726 }
catch (Exception e) {
727 throw new XQException(
"Error setting implicit TimeZone: " + e.getLocalizedMessage());
740 public void bindItem(QName varName, XQItem value)
throws XQException {
741 isClosedXQException();
742 isNullXQException(varName);
743 isNullXQException(value);
744 if (!isExternal(varName.getLocalPart())) {
745 throw new XQException (
"The bound variable must be declared external in the prepared expression.");
748 dynamicContext.setVariable(varName.getLocalPart(), ((org.zorbaxquery.api.xqj.ZorbaXQItem)value).getZorbaItem());
749 itemsBounded.add(varName.getLocalPart());
750 }
catch (Exception e) {
751 throw new XQException (
"Error binding item: " + varName.getLocalPart() +
" with error: " + e.getLocalizedMessage());
764 public void bindSequence(QName varName, XQSequence value)
throws XQException {
765 isClosedXQException();
766 isNullXQException(varName);
767 isNullXQException(value);
768 if (value.isClosed()) {
769 throw new XQException (
"Sequence is closed.");
771 if (!isExternal(varName.getLocalPart())) {
772 throw new XQException (
"The bound variable must be declared external in the prepared expression.");
775 if (!value.isOnItem()) {
778 Item item =
new Item(((org.zorbaxquery.api.xqj.ZorbaXQItem)value.getItem()).getZorbaItem());
781 dynamicContext.setVariable(varName.getLocalPart(), item);
782 itemsBounded.add(varName.getLocalPart());
783 }
catch (Exception e) {
784 throw new XQException (
"Error binding item: " + varName.getLocalPart() +
" with error: " + e.getLocalizedMessage());
798 public void bindObject(QName varName, Object value, XQItemType type)
throws XQException {
799 isClosedXQException();
800 isNullXQException(varName);
801 isNullXQException(value);
802 if (!isExternal(varName.getLocalPart())) {
803 throw new XQException (
"The bound variable must be declared external in the prepared expression.");
806 XQItem item = connection.createItemFromObject(value, type);
807 dynamicContext.setVariable(varName.getLocalPart(), ((org.zorbaxquery.api.xqj.ZorbaXQItem)item).getZorbaItem());
808 itemsBounded.add(varName.getLocalPart());
809 }
catch (Exception e) {
810 throw new XQException (
"Error binding object: " + e.getLocalizedMessage());
824 public void bindBoolean(QName varName,
boolean value, XQItemType type)
throws XQException {
825 isClosedXQException();
826 isNullXQException(varName);
827 if (!isExternal(varName.getLocalPart())) {
828 throw new XQException (
"The bound variable must be declared external in the prepared expression.");
831 XQItem item = connection.createItemFromBoolean(value, type);
832 dynamicContext.setVariable(varName.getLocalPart(), ((org.zorbaxquery.api.xqj.ZorbaXQItem)item).getZorbaItem());
833 itemsBounded.add(varName.getLocalPart());
834 }
catch (Exception e) {
835 throw new XQException (
"Error binding object: " + e.getLocalizedMessage());
849 public void bindByte(QName varName, byte value, XQItemType type)
throws XQException {
850 isClosedXQException();
851 isNullXQException(varName);
852 if (!isExternal(varName.getLocalPart())) {
853 throw new XQException (
"The bound variable must be declared external in the prepared expression.");
856 XQItem item = connection.createItemFromByte(value, type);
857 dynamicContext.setVariable(varName.getLocalPart(), ((org.zorbaxquery.api.xqj.ZorbaXQItem)item).getZorbaItem());
858 itemsBounded.add(varName.getLocalPart());
859 }
catch (Exception e) {
860 throw new XQException (
"Error binding object: " + e.getLocalizedMessage());
874 public void bindDouble(QName varName,
double value, XQItemType type)
throws XQException {
875 isClosedXQException();
876 isNullXQException(varName);
877 if (!isExternal(varName.getLocalPart())) {
878 throw new XQException (
"The bound variable must be declared external in the prepared expression.");
881 XQItem item = connection.createItemFromDouble(value, type);
882 dynamicContext.setVariable(varName.getLocalPart(), ((org.zorbaxquery.api.xqj.ZorbaXQItem)item).getZorbaItem());
883 itemsBounded.add(varName.getLocalPart());
884 }
catch (Exception e) {
885 throw new XQException (
"Error binding object: " + e.getLocalizedMessage());
899 public void bindFloat(QName varName,
float value, XQItemType type)
throws XQException {
900 isClosedXQException();
901 isNullXQException(varName);
902 if (!isExternal(varName.getLocalPart())) {
903 throw new XQException (
"The bound variable must be declared external in the prepared expression.");
906 XQItem item = connection.createItemFromFloat(value, type);
907 dynamicContext.setVariable(varName.getLocalPart(), ((org.zorbaxquery.api.xqj.ZorbaXQItem)item).getZorbaItem());
908 itemsBounded.add(varName.getLocalPart());
909 }
catch (Exception e) {
910 throw new XQException (
"Error binding object: " + e.getLocalizedMessage());
924 public void bindInt(QName varName,
int value, XQItemType type)
throws XQException {
925 isClosedXQException();
926 isNullXQException(varName);
927 if (!isExternal(varName.getLocalPart())) {
928 throw new XQException (
"The bound variable must be declared external in the prepared expression.");
931 XQItem item = connection.createItemFromInt(value, type);
932 dynamicContext.setVariable(varName.getLocalPart(), ((org.zorbaxquery.api.xqj.ZorbaXQItem)item).getZorbaItem());
933 itemsBounded.add(varName.getLocalPart());
934 }
catch (Exception e) {
935 throw new XQException (
"Error binding object: " + e.getLocalizedMessage());
949 public void bindLong(QName varName,
long value, XQItemType type)
throws XQException {
950 isClosedXQException();
951 isNullXQException(varName);
952 if (!isExternal(varName.getLocalPart())) {
953 throw new XQException (
"The bound variable must be declared external in the prepared expression.");
956 XQItem item = connection.createItemFromLong(value, type);
957 dynamicContext.setVariable(varName.getLocalPart(), ((org.zorbaxquery.api.xqj.ZorbaXQItem)item).getZorbaItem());
958 itemsBounded.add(varName.getLocalPart());
959 }
catch (Exception e) {
960 throw new XQException (
"Error binding object: " + e.getLocalizedMessage());
974 public void bindNode(QName varName, Node value, XQItemType type)
throws XQException {
975 isClosedXQException();
976 isNullXQException(value);
977 isNullXQException(varName);
978 if (!isExternal(varName.getLocalPart())) {
979 throw new XQException (
"The bound variable must be declared external in the prepared expression.");
982 XQItem item = connection.createItemFromNode(value, type);
983 dynamicContext.setVariable(varName.getLocalPart(), ((org.zorbaxquery.api.xqj.ZorbaXQItem)item).getZorbaItem());
984 itemsBounded.add(varName.getLocalPart());
985 }
catch (Exception e) {
986 throw new XQException (
"Error binding object: " + e.getLocalizedMessage());
1000 public void bindShort(QName varName,
short value, XQItemType type)
throws XQException {
1001 isClosedXQException();
1002 isNullXQException(varName);
1003 if (!isExternal(varName.getLocalPart())) {
1004 throw new XQException (
"The bound variable must be declared external in the prepared expression.");
1007 XQItem item = connection.createItemFromShort(value, type);
1008 dynamicContext.setVariable(varName.getLocalPart(), ((org.zorbaxquery.api.xqj.ZorbaXQItem)item).getZorbaItem());
1009 itemsBounded.add(varName.getLocalPart());
1010 }
catch (Exception e) {
1011 throw new XQException (
"Error binding object: " + e.getLocalizedMessage());
1015 private void isClosedXQException() throws XQException {
1017 throw new XQException(
"This prepared expression is closed");
1020 private void isNullXQException(Object value)
throws XQException {
1022 throw new XQException(
"Parameter shouldn't be null");
void bindFloat(QName varName, float value, XQItemType type)
Binds a value to the given external variable or the context item.
void bindNode(QName varName, Node value, XQItemType type)
Binds a value to the given external variable or the context item.
An ZorbaXQStaticContext represents default values for various XQuery Static Context Components...
void bindItem(QName varName, XQItem value)
Binds a value to the given external variable.
void bindDouble(QName varName, double value, XQItemType type)
Binds a value to the given external variable or the context item.
A connection (session) with a specific XQuery engine.
This class describes an expression that can be prepared for multiple subsequent executions.
The ZorbaXQSequenceType interface represents a sequence type as XQuery 1.0: An XML Query language...
XQResultSequence executeQuery()
Executes the prepared query expression.
ZorbaXQPreparedExpression(XQConnection conn, String string, XQStaticContext sc)
XQSequenceType getStaticVariableType(QName varName)
Retrieves the static type of a given external variable.
ZorbaXQPreparedExpression(XQConnection conn, InputStream input, XQStaticContext sc)
ZorbaXQPreparedExpression(XQConnection conn, InputStream input)
void bindSequence(QName varName, XQSequence value)
Binds a value to the given external variable or the context item.
The ZorbaXQItemType class represents an item type as defined in XQuery 1.0: An XML Query language...
void bindDocument(QName varName, String value, String baseURI, XQItemType type)
Binds a value to the given external variable or the context item.
QName[] getAllUnboundExternalVariables()
Retrieves the names of all unbound external variables.
void bindString(QName varName, String value, XQItemType type)
Binds a value to the given external variable or the context item.
TimeZone getImplicitTimeZone()
Gets the implicit timezone.
void bindDocument(QName varName, InputStream value, String baseURI, XQItemType type)
Binds a value to the given external variable or the context item.
void bindBoolean(QName varName, boolean value, XQItemType type)
Binds a value to the given external variable or the context item.
QName[] getAllExternalVariables()
Retrieves all the external variables defined in the prolog of the prepared expression.
void bindShort(QName varName, short value, XQItemType type)
Binds a value to the given external variable or the context item.
void bindObject(QName varName, Object value, XQItemType type)
Binds a value to the given external variable or the context item.
ZorbaXQPreparedExpression(XQConnection conn, Reader reader)
XQStaticContext getStaticContext()
Gets an ZorbaXQStaticContext representing the values for all expression properties.
void setImplicitTimeZone(TimeZone value)
Sets the implicit timezone.
void bindByte(QName varName, byte value, XQItemType type)
Binds a value to the given external variable or the context item.
ZorbaXQPreparedExpression(XQConnection conn, Reader reader, XQStaticContext sc)
void bindDocument(QName varName, Reader value, String baseURI, XQItemType type)
Binds a value to the given external variable or the context item.
void close()
Closes the expression object and release all resources associated with this prepared expression...
void bindInt(QName varName, int value, XQItemType type)
Binds a value to the given external variable or the context item.
ZorbaXQPreparedExpression(XQConnection conn, String string)
This class represents a sequence of items obtained as a result of evaluation XQuery expressions...
boolean isClosed()
Checks if the prepared expression in a closed state.
void bindAtomicValue(QName varName, String value, XQItemType type)
Binds a value to the given external variable or the context item.
void cancel()
Attempts to cancel the execution if both the XQuery engine and XQJ driver support aborting the execut...
void bindLong(QName varName, long value, XQItemType type)
Binds a value to the given external variable or the context item.
void bindDocument(QName varName, XMLStreamReader value, XQItemType type)
Binds a value to the given external variable or the context item.
XQSequenceType getStaticResultType()
Gets the static type information of the result sequence.
void bindDocument(QName varName, Source value, XQItemType type)
Binds a value to the given external variable or the context item.