<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_18) on Fri Dec 09 20:48:46 GMT 2011 --> <TITLE> XQConnection </TITLE> <META NAME="date" CONTENT="2011-12-09"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="XQConnection"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../javax/xml/xquery/XQCancelledException.html" title="class in javax.xml.xquery"><B>PREV CLASS</B></A> <A HREF="../../../javax/xml/xquery/XQConnectionEvent.html" title="class in javax.xml.xquery"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?javax/xml/xquery/XQConnection.html" target="_top"><B>FRAMES</B></A> <A HREF="XQConnection.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> javax.xml.xquery</FONT> <BR> Interface XQConnection</H2> <DL> <DT><B>All Superinterfaces:</B> <DD><A HREF="../../../javax/xml/xquery/XQDataFactory.html" title="interface in javax.xml.xquery">XQDataFactory</A></DD> </DL> <DL> <DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../net/sf/saxon/xqj/SaxonXQConnection.html" title="class in net.sf.saxon.xqj">SaxonXQConnection</A></DD> </DL> <HR> <DL> <DT><PRE>public interface <B>XQConnection</B><DT>extends <A HREF="../../../javax/xml/xquery/XQDataFactory.html" title="interface in javax.xml.xquery">XQDataFactory</A></DL> </PRE> <P> A connection (session) with a specific XQuery engine. Connections are obtained through an <code>XQDataSource</code> object. <p> XQuery expressions are executed and results are returned within the context of a connection. They are either executed through <code>XQExpression</code> or <code>XQPreparedExpression</code> objects. <p> <pre> XQDataSource ds;// obtain the XQuery datasource ... XQConnection conn = ds.getConnection(); XQPreparedExpression expr = conn.prepareExpression("for $i in ..."); XQResultSequence result = expr.executeQuery(); // - or - XQExpression expr = conn.createExpression(); XQSequence 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.. </pre> A connection holds also default values for <code>XQExpression</code> and <code>XQPreparedExpression</code> properties. An application can override these defaults by passing an <code>XQStaticContext</code> object to the <code>setStaticContext()</code> method. <p> By default a connection operates in auto-commit mode, which means that each xquery is executed and committed in an individual transaction. If auto-commit mode is disabled, a transaction must be ended explicitly by the application calling <code>commit()</code> or <code>rollback()</code>. <p> An <code>XQConnection</code> object can be created on top of an existing JDBC connection. If an <code>XQConnection</code> is created on top of the JDBC connection, it inherits the transaction context from the JDBC connection. Also, in this case, if the auto-commit mode is changed, or a transaction is ended using commit or rollback, it also changes the underlying JDBC connection. <p> 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 explicitly might result in serious memory leaks. <p> When the <code>XQConnection</code> is closed any <code>XQExpression</code> and <code>XQPreparedExpression</code> objects obtained from it are also implicitly closed. <p> <P> <P> <HR> <P> <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Method Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../javax/xml/xquery/XQConnection.html#close()">close</A></B>()</CODE> <BR> Closes the connection.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../javax/xml/xquery/XQConnection.html#commit()">commit</A></B>()</CODE> <BR> Makes all changes made in the current transaction permanent and releases any locks held by the datasource.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../javax/xml/xquery/XQExpression.html" title="interface in javax.xml.xquery">XQExpression</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../javax/xml/xquery/XQConnection.html#createExpression()">createExpression</A></B>()</CODE> <BR> Creates a new <code>XQExpression</code> object that can be used to perform execute immediate operations with XQuery expressions.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../javax/xml/xquery/XQExpression.html" title="interface in javax.xml.xquery">XQExpression</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../javax/xml/xquery/XQConnection.html#createExpression(javax.xml.xquery.XQStaticContext)">createExpression</A></B>(<A HREF="../../../javax/xml/xquery/XQStaticContext.html" title="interface in javax.xml.xquery">XQStaticContext</A> properties)</CODE> <BR> Creates a new <code>XQExpression</code> object that can be used to perform execute immediate operations with XQuery expressions.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../javax/xml/xquery/XQConnection.html#getAutoCommit()">getAutoCommit</A></B>()</CODE> <BR> Gets the auto-commit attribute of this connection</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../javax/xml/xquery/XQMetaData.html" title="interface in javax.xml.xquery">XQMetaData</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../javax/xml/xquery/XQConnection.html#getMetaData()">getMetaData</A></B>()</CODE> <BR> Gets the metadata for this connection.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../javax/xml/xquery/XQStaticContext.html" title="interface in javax.xml.xquery">XQStaticContext</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../javax/xml/xquery/XQConnection.html#getStaticContext()">getStaticContext</A></B>()</CODE> <BR> Gets an <code>XQStaticContext</code> representing the default values for all expression properties.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../javax/xml/xquery/XQConnection.html#isClosed()">isClosed</A></B>()</CODE> <BR> Checks if the connection is closed.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../javax/xml/xquery/XQPreparedExpression.html" title="interface in javax.xml.xquery">XQPreparedExpression</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../javax/xml/xquery/XQConnection.html#prepareExpression(java.io.InputStream)">prepareExpression</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</A> xquery)</CODE> <BR> Prepares an expression for execution.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../javax/xml/xquery/XQPreparedExpression.html" title="interface in javax.xml.xquery">XQPreparedExpression</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../javax/xml/xquery/XQConnection.html#prepareExpression(java.io.InputStream, javax.xml.xquery.XQStaticContext)">prepareExpression</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</A> xquery, <A HREF="../../../javax/xml/xquery/XQStaticContext.html" title="interface in javax.xml.xquery">XQStaticContext</A> properties)</CODE> <BR> Prepares an expression for execution.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../javax/xml/xquery/XQPreparedExpression.html" title="interface in javax.xml.xquery">XQPreparedExpression</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../javax/xml/xquery/XQConnection.html#prepareExpression(java.io.Reader)">prepareExpression</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/io/Reader.html?is-external=true" title="class or interface in java.io">Reader</A> xquery)</CODE> <BR> Prepares an expression for execution.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../javax/xml/xquery/XQPreparedExpression.html" title="interface in javax.xml.xquery">XQPreparedExpression</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../javax/xml/xquery/XQConnection.html#prepareExpression(java.io.Reader, javax.xml.xquery.XQStaticContext)">prepareExpression</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/io/Reader.html?is-external=true" title="class or interface in java.io">Reader</A> xquery, <A HREF="../../../javax/xml/xquery/XQStaticContext.html" title="interface in javax.xml.xquery">XQStaticContext</A> properties)</CODE> <BR> Prepares an expression for execution.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../javax/xml/xquery/XQPreparedExpression.html" title="interface in javax.xml.xquery">XQPreparedExpression</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../javax/xml/xquery/XQConnection.html#prepareExpression(java.lang.String)">prepareExpression</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> xquery)</CODE> <BR> Prepares an expression for execution.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../javax/xml/xquery/XQPreparedExpression.html" title="interface in javax.xml.xquery">XQPreparedExpression</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../javax/xml/xquery/XQConnection.html#prepareExpression(java.lang.String, javax.xml.xquery.XQStaticContext)">prepareExpression</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> xquery, <A HREF="../../../javax/xml/xquery/XQStaticContext.html" title="interface in javax.xml.xquery">XQStaticContext</A> properties)</CODE> <BR> Prepares an expression for execution.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../javax/xml/xquery/XQConnection.html#rollback()">rollback</A></B>()</CODE> <BR> Undoes all changes made in the current transaction and releases any locks held by the datasource.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../javax/xml/xquery/XQConnection.html#setAutoCommit(boolean)">setAutoCommit</A></B>(boolean autoCommit)</CODE> <BR> Sets the auto-commit attribute to the given state.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../javax/xml/xquery/XQConnection.html#setStaticContext(javax.xml.xquery.XQStaticContext)">setStaticContext</A></B>(<A HREF="../../../javax/xml/xquery/XQStaticContext.html" title="interface in javax.xml.xquery">XQStaticContext</A> properties)</CODE> <BR> Sets the default values for all expression properties.</TD> </TR> </TABLE> <A NAME="methods_inherited_from_class_javax.xml.xquery.XQDataFactory"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from interface javax.xml.xquery.<A HREF="../../../javax/xml/xquery/XQDataFactory.html" title="interface in javax.xml.xquery">XQDataFactory</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../javax/xml/xquery/XQDataFactory.html#createAtomicType(int)">createAtomicType</A>, <A HREF="../../../javax/xml/xquery/XQDataFactory.html#createAtomicType(int, javax.xml.namespace.QName, java.net.URI)">createAtomicType</A>, <A HREF="../../../javax/xml/xquery/XQDataFactory.html#createAttributeType(javax.xml.namespace.QName, int)">createAttributeType</A>, <A HREF="../../../javax/xml/xquery/XQDataFactory.html#createAttributeType(javax.xml.namespace.QName, int, javax.xml.namespace.QName, java.net.URI)">createAttributeType</A>, <A HREF="../../../javax/xml/xquery/XQDataFactory.html#createCommentType()">createCommentType</A>, <A HREF="../../../javax/xml/xquery/XQDataFactory.html#createDocumentElementType(javax.xml.xquery.XQItemType)">createDocumentElementType</A>, <A HREF="../../../javax/xml/xquery/XQDataFactory.html#createDocumentSchemaElementType(javax.xml.xquery.XQItemType)">createDocumentSchemaElementType</A>, <A HREF="../../../javax/xml/xquery/XQDataFactory.html#createDocumentType()">createDocumentType</A>, <A HREF="../../../javax/xml/xquery/XQDataFactory.html#createElementType(javax.xml.namespace.QName, int)">createElementType</A>, <A HREF="../../../javax/xml/xquery/XQDataFactory.html#createElementType(javax.xml.namespace.QName, int, javax.xml.namespace.QName, java.net.URI, boolean)">createElementType</A>, <A HREF="../../../javax/xml/xquery/XQDataFactory.html#createItem(javax.xml.xquery.XQItem)">createItem</A>, <A HREF="../../../javax/xml/xquery/XQDataFactory.html#createItemFromAtomicValue(java.lang.String, javax.xml.xquery.XQItemType)">createItemFromAtomicValue</A>, <A HREF="../../../javax/xml/xquery/XQDataFactory.html#createItemFromBoolean(boolean, javax.xml.xquery.XQItemType)">createItemFromBoolean</A>, <A HREF="../../../javax/xml/xquery/XQDataFactory.html#createItemFromByte(byte, javax.xml.xquery.XQItemType)">createItemFromByte</A>, <A HREF="../../../javax/xml/xquery/XQDataFactory.html#createItemFromDocument(java.io.InputStream, java.lang.String, javax.xml.xquery.XQItemType)">createItemFromDocument</A>, <A HREF="../../../javax/xml/xquery/XQDataFactory.html#createItemFromDocument(java.io.Reader, java.lang.String, javax.xml.xquery.XQItemType)">createItemFromDocument</A>, <A HREF="../../../javax/xml/xquery/XQDataFactory.html#createItemFromDocument(javax.xml.transform.Source, javax.xml.xquery.XQItemType)">createItemFromDocument</A>, <A HREF="../../../javax/xml/xquery/XQDataFactory.html#createItemFromDocument(java.lang.String, java.lang.String, javax.xml.xquery.XQItemType)">createItemFromDocument</A>, <A HREF="../../../javax/xml/xquery/XQDataFactory.html#createItemFromDocument(javax.xml.stream.XMLStreamReader, javax.xml.xquery.XQItemType)">createItemFromDocument</A>, <A HREF="../../../javax/xml/xquery/XQDataFactory.html#createItemFromDouble(double, javax.xml.xquery.XQItemType)">createItemFromDouble</A>, <A HREF="../../../javax/xml/xquery/XQDataFactory.html#createItemFromFloat(float, javax.xml.xquery.XQItemType)">createItemFromFloat</A>, <A HREF="../../../javax/xml/xquery/XQDataFactory.html#createItemFromInt(int, javax.xml.xquery.XQItemType)">createItemFromInt</A>, <A HREF="../../../javax/xml/xquery/XQDataFactory.html#createItemFromLong(long, javax.xml.xquery.XQItemType)">createItemFromLong</A>, <A HREF="../../../javax/xml/xquery/XQDataFactory.html#createItemFromNode(org.w3c.dom.Node, javax.xml.xquery.XQItemType)">createItemFromNode</A>, <A HREF="../../../javax/xml/xquery/XQDataFactory.html#createItemFromObject(java.lang.Object, javax.xml.xquery.XQItemType)">createItemFromObject</A>, <A HREF="../../../javax/xml/xquery/XQDataFactory.html#createItemFromShort(short, javax.xml.xquery.XQItemType)">createItemFromShort</A>, <A HREF="../../../javax/xml/xquery/XQDataFactory.html#createItemFromString(java.lang.String, javax.xml.xquery.XQItemType)">createItemFromString</A>, <A HREF="../../../javax/xml/xquery/XQDataFactory.html#createItemType()">createItemType</A>, <A HREF="../../../javax/xml/xquery/XQDataFactory.html#createNodeType()">createNodeType</A>, <A HREF="../../../javax/xml/xquery/XQDataFactory.html#createProcessingInstructionType(java.lang.String)">createProcessingInstructionType</A>, <A HREF="../../../javax/xml/xquery/XQDataFactory.html#createSchemaAttributeType(javax.xml.namespace.QName, int, java.net.URI)">createSchemaAttributeType</A>, <A HREF="../../../javax/xml/xquery/XQDataFactory.html#createSchemaElementType(javax.xml.namespace.QName, int, java.net.URI)">createSchemaElementType</A>, <A HREF="../../../javax/xml/xquery/XQDataFactory.html#createSequence(java.util.Iterator)">createSequence</A>, <A HREF="../../../javax/xml/xquery/XQDataFactory.html#createSequence(javax.xml.xquery.XQSequence)">createSequence</A>, <A HREF="../../../javax/xml/xquery/XQDataFactory.html#createSequenceType(javax.xml.xquery.XQItemType, int)">createSequenceType</A>, <A HREF="../../../javax/xml/xquery/XQDataFactory.html#createTextType()">createTextType</A></CODE></TD> </TR> </TABLE> <P> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Method Detail</B></FONT></TH> </TR> </TABLE> <A NAME="close()"><!-- --></A><H3> close</H3> <PRE> void <B>close</B>() throws <A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></PRE> <DL> <DD>Closes the connection. This also closes any <code>XQExpression</code> and <code>XQPreparedExpression</code> obtained from this connection. Once the connection is closed, no method other than <code>close</code> or the <code>isClosed</code> method may be called on the connection object. Calling close on an <code>XQConnection</code> 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. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Throws:</B> <DD><CODE><A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></CODE> - if there is an error during closing the connection.</DL> </DD> </DL> <HR> <A NAME="setAutoCommit(boolean)"><!-- --></A><H3> setAutoCommit</H3> <PRE> void <B>setAutoCommit</B>(boolean autoCommit) throws <A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></PRE> <DL> <DD>Sets the auto-commit attribute to the given state. If a connection is in auto-commit mode, each xquery is executed and committed in an individual transaction. When auto-commit mode is disabled, xqueries are grouped in a transaction that must be ended explicitly by the application calling <code>commit()</code> or <code>rollback()</code>.<br> By default, new connections are in auto-commit mode.<br> If the value of auto-commit is changed in the middle of a transaction, the transaction is committed. If <code>setAutoCommit</code> is called and the auto-commit attribute is not changed from its current value, the request is treated as a no-op. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>autoCommit</CODE> - <code>true</code> to enable auto-commit mode; <code>false</code> to disable it <DT><B>Throws:</B> <DD><CODE><A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></CODE> - if (1) the connection is in a closed state, or (2) auto-commit is turned off but the implementation doesn't support transactions</DL> </DD> </DL> <HR> <A NAME="getAutoCommit()"><!-- --></A><H3> getAutoCommit</H3> <PRE> boolean <B>getAutoCommit</B>() throws <A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></PRE> <DL> <DD>Gets the auto-commit attribute of this connection <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the auto-commit attribute of this connection. <code>true</code> if the connection operates in auto-commit mode; otherwise <code>false</code> <DT><B>Throws:</B> <DD><CODE><A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></CODE> - if the connection is in a closed state</DL> </DD> </DL> <HR> <A NAME="commit()"><!-- --></A><H3> commit</H3> <PRE> void <B>commit</B>() throws <A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></PRE> <DL> <DD>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 <code>XQResultSequence</code>, or <code>XQResultItem</code> may be implicitly closed upon commit, if the holdability property of the sequence is set to <code>XQConstants.HOLDTYPE_CLOSE_CURSORS_AT_COMMIT</code>. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Throws:</B> <DD><CODE><A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></CODE> - if the connection is in a closed state or this connection is operating in auto-commit mode</DL> </DD> </DL> <HR> <A NAME="createExpression()"><!-- --></A><H3> createExpression</H3> <PRE> <A HREF="../../../javax/xml/xquery/XQExpression.html" title="interface in javax.xml.xquery">XQExpression</A> <B>createExpression</B>() throws <A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></PRE> <DL> <DD>Creates a new <code>XQExpression</code> object that can be used to perform execute immediate operations with XQuery expressions. The properties of the connection's default <code>XQStaticContext</code> are copied to the returned <code>XQExpression</code>. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Returns:</B><DD><code>XQExpression</code> that can be used to execute multiple expressions <DT><B>Throws:</B> <DD><CODE><A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></CODE> - if the connection is in a closed state</DL> </DD> </DL> <HR> <A NAME="createExpression(javax.xml.xquery.XQStaticContext)"><!-- --></A><H3> createExpression</H3> <PRE> <A HREF="../../../javax/xml/xquery/XQExpression.html" title="interface in javax.xml.xquery">XQExpression</A> <B>createExpression</B>(<A HREF="../../../javax/xml/xquery/XQStaticContext.html" title="interface in javax.xml.xquery">XQStaticContext</A> properties) throws <A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></PRE> <DL> <DD>Creates a new <code>XQExpression</code> object that can be used to perform execute immediate operations with XQuery expressions. The properties of the specified <code>XQStaticContext</code> values are copied to the returned <code>XQExpression</code>. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>properties</CODE> - <code>XQStaticContext</code> containing values of expression properties <DT><B>Returns:</B><DD><code>XQExpression</code> that can be used to execute multiple expressions <DT><B>Throws:</B> <DD><CODE><A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></CODE> - if (1) the connection is in a closed state, or (2) the specified argument is <code>null</code></DL> </DD> </DL> <HR> <A NAME="getMetaData()"><!-- --></A><H3> getMetaData</H3> <PRE> <A HREF="../../../javax/xml/xquery/XQMetaData.html" title="interface in javax.xml.xquery">XQMetaData</A> <B>getMetaData</B>() throws <A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></PRE> <DL> <DD>Gets the metadata for this connection. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Returns:</B><DD><code>XQMetadata</code> representing the metadata of this connection <DT><B>Throws:</B> <DD><CODE><A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></CODE> - if the connection is in a closed state</DL> </DD> </DL> <HR> <A NAME="isClosed()"><!-- --></A><H3> isClosed</H3> <PRE> boolean <B>isClosed</B>()</PRE> <DL> <DD>Checks if the connection is closed. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Returns:</B><DD><code>true</code> if the connection is in a closed state, <code>false</code> otherwise</DL> </DD> </DL> <HR> <A NAME="prepareExpression(java.lang.String)"><!-- --></A><H3> prepareExpression</H3> <PRE> <A HREF="../../../javax/xml/xquery/XQPreparedExpression.html" title="interface in javax.xml.xquery">XQPreparedExpression</A> <B>prepareExpression</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> xquery) throws <A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></PRE> <DL> <DD>Prepares an expression for execution. <p> The properties of the connection's default <code>XQStaticContext</code> are copied to the returned <code>XQPreparedExpression</code>. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>xquery</CODE> - the XQuery expression as a <code>String</code>. Cannot be <code>null</code> <DT><B>Returns:</B><DD>the prepared XQuery expression <DT><B>Throws:</B> <DD><CODE><A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></CODE> - if (1) the connection is in a closed state, (2) there are errors preparing the expression, or (3) the xquery parameter is <code>null</code></DL> </DD> </DL> <HR> <A NAME="prepareExpression(java.lang.String, javax.xml.xquery.XQStaticContext)"><!-- --></A><H3> prepareExpression</H3> <PRE> <A HREF="../../../javax/xml/xquery/XQPreparedExpression.html" title="interface in javax.xml.xquery">XQPreparedExpression</A> <B>prepareExpression</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> xquery, <A HREF="../../../javax/xml/xquery/XQStaticContext.html" title="interface in javax.xml.xquery">XQStaticContext</A> properties) throws <A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></PRE> <DL> <DD>Prepares an expression for execution. <p> The properties of the specified <code>XQStaticContext</code> values are copied to the returned <code>XQPreparedExpression</code>. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>xquery</CODE> - the XQuery expression as a <code>String</code>. Cannot be <code>null</code><DD><CODE>properties</CODE> - <code>XQStaticContext</code> containing values of expression properties. <DT><B>Returns:</B><DD>the prepared XQuery expression <DT><B>Throws:</B> <DD><CODE><A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></CODE> - if (1) the connection is in a closed state, or (2) the specified argument is <code>null</code></DL> </DD> </DL> <HR> <A NAME="prepareExpression(java.io.Reader)"><!-- --></A><H3> prepareExpression</H3> <PRE> <A HREF="../../../javax/xml/xquery/XQPreparedExpression.html" title="interface in javax.xml.xquery">XQPreparedExpression</A> <B>prepareExpression</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/io/Reader.html?is-external=true" title="class or interface in java.io">Reader</A> xquery) throws <A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></PRE> <DL> <DD>Prepares an expression for execution. <p> The properties of the connection's default <code>XQStaticContext</code> are copied to the returned <code>XQPreparedExpression</code>. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>xquery</CODE> - the XQuery expression as a <code>Reader</code>. Cannot be <code>null</code> <DT><B>Returns:</B><DD>the prepared XQuery expression <DT><B>Throws:</B> <DD><CODE><A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></CODE> - if (1) the connection is in a closed state, (2) there are errors preparing the expression, or (3) the xquery parameter is <code>null</code></DL> </DD> </DL> <HR> <A NAME="prepareExpression(java.io.Reader, javax.xml.xquery.XQStaticContext)"><!-- --></A><H3> prepareExpression</H3> <PRE> <A HREF="../../../javax/xml/xquery/XQPreparedExpression.html" title="interface in javax.xml.xquery">XQPreparedExpression</A> <B>prepareExpression</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/io/Reader.html?is-external=true" title="class or interface in java.io">Reader</A> xquery, <A HREF="../../../javax/xml/xquery/XQStaticContext.html" title="interface in javax.xml.xquery">XQStaticContext</A> properties) throws <A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></PRE> <DL> <DD>Prepares an expression for execution. <p> The properties of the specified <code>XQStaticContext</code> values are copied to the returned <code>XQPreparedExpression</code>. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>xquery</CODE> - the XQuery expression as a <code>Reader</code>. Cannot be <code>null</code><DD><CODE>properties</CODE> - <code>XQStaticContext</code> containing values of expression properties <DT><B>Returns:</B><DD>the prepared XQuery expression <DT><B>Throws:</B> <DD><CODE><A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></CODE> - if (1) the connection is in a closed state, or (2) the specified argument is <code>null</code></DL> </DD> </DL> <HR> <A NAME="prepareExpression(java.io.InputStream)"><!-- --></A><H3> prepareExpression</H3> <PRE> <A HREF="../../../javax/xml/xquery/XQPreparedExpression.html" title="interface in javax.xml.xquery">XQPreparedExpression</A> <B>prepareExpression</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</A> xquery) throws <A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></PRE> <DL> <DD>Prepares an expression for execution. <p> The properties of the connection's default <code>XQStaticContext</code> are copied to the returned <code>XQPreparedExpression</code>. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>xquery</CODE> - the XQuery expression as an <code>InputStream</code>. Cannot be <code>null</code> <DT><B>Returns:</B><DD>the prepared XQuery expression <DT><B>Throws:</B> <DD><CODE><A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></CODE> - if (1) the connection is in a closed state, (2) there are errors preparing the expression or (3) the xquery parameter is <code>null</code></DL> </DD> </DL> <HR> <A NAME="prepareExpression(java.io.InputStream, javax.xml.xquery.XQStaticContext)"><!-- --></A><H3> prepareExpression</H3> <PRE> <A HREF="../../../javax/xml/xquery/XQPreparedExpression.html" title="interface in javax.xml.xquery">XQPreparedExpression</A> <B>prepareExpression</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</A> xquery, <A HREF="../../../javax/xml/xquery/XQStaticContext.html" title="interface in javax.xml.xquery">XQStaticContext</A> properties) throws <A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></PRE> <DL> <DD>Prepares an expression for execution. <p> The properties of the specified <code>XQStaticContext</code> values are copied to the returned <code>XQPreparedExpression</code>. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>xquery</CODE> - the XQuery expression as an <code>InputStream</code>. Cannot be <code>null</code><DD><CODE>properties</CODE> - <code>XQStaticContext</code> containing values of expression properties <DT><B>Returns:</B><DD>the prepared XQuery expression <DT><B>Throws:</B> <DD><CODE><A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></CODE> - if (1) the connection is in a closed state, or (2) the specified argument is <code>null</code></DL> </DD> </DL> <HR> <A NAME="rollback()"><!-- --></A><H3> rollback</H3> <PRE> void <B>rollback</B>() throws <A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></PRE> <DL> <DD>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. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Throws:</B> <DD><CODE><A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></CODE> - if the connection is in a closed state or this connection is operating in auto-commit mode</DL> </DD> </DL> <HR> <A NAME="getStaticContext()"><!-- --></A><H3> getStaticContext</H3> <PRE> <A HREF="../../../javax/xml/xquery/XQStaticContext.html" title="interface in javax.xml.xquery">XQStaticContext</A> <B>getStaticContext</B>() throws <A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></PRE> <DL> <DD>Gets an <code>XQStaticContext</code> 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 <code>XQStaticContext</code> object; in addition <code>setStaticContext</code> should be called to make those new values effective. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Returns:</B><DD><code>XQStaticContext</code> representing the default values for all expression properties <DT><B>Throws:</B> <DD><CODE><A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></CODE> - if the connection is in a closed state</DL> </DD> </DL> <HR> <A NAME="setStaticContext(javax.xml.xquery.XQStaticContext)"><!-- --></A><H3> setStaticContext</H3> <PRE> void <B>setStaticContext</B>(<A HREF="../../../javax/xml/xquery/XQStaticContext.html" title="interface in javax.xml.xquery">XQStaticContext</A> properties) throws <A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></PRE> <DL> <DD>Sets the default values for all expression properties. The implementation will read out all expression properties from the specified <code>XQStaticContext</code> and update its private copy. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>properties</CODE> - <code>XQStaticContext</code> containing values of expression properties <DT><B>Throws:</B> <DD><CODE><A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></CODE> - if the connection is in a closed state</DL> </DD> </DL> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../javax/xml/xquery/XQCancelledException.html" title="class in javax.xml.xquery"><B>PREV CLASS</B></A> <A HREF="../../../javax/xml/xquery/XQConnectionEvent.html" title="class in javax.xml.xquery"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?javax/xml/xquery/XQConnection.html" target="_top"><B>FRAMES</B></A> <A HREF="XQConnection.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> Copyright (c) 2004-2011 Saxonica Limited. All rights reserved. </BODY> </HTML>