net.sf.saxon.xqj
Class SaxonXQConnection

java.lang.Object
  extended by net.sf.saxon.xqj.Closable
      extended by net.sf.saxon.xqj.SaxonXQDataFactory
          extended by net.sf.saxon.xqj.SaxonXQConnection
All Implemented Interfaces:
javax.xml.xquery.XQConnection, javax.xml.xquery.XQDataFactory

public class SaxonXQConnection
extends SaxonXQDataFactory
implements javax.xml.xquery.XQConnection

Saxon implementation of the XQL interface XQConnection. This interface represents a "connection" between an XQuery application and an XQuery server. In Saxon the client and server run in the same process so the concept of a connection is rather notional, and some of the properties have little meaning. However, the connection is the factory object used to compile queries.

For Javadoc descriptions of the public methors, see the XQJ documentation.


Constructor Summary
SaxonXQConnection(SaxonXQDataSource dataSource)
          Create an SaxonXQConnection from a SaxonXQDataSource
 
Method Summary
 void commit()
           
 javax.xml.xquery.XQPreparedExpression copyPreparedExpression(javax.xml.xquery.XQPreparedExpression expression)
          Copy a prepared expression to create a new prepared expression.
 javax.xml.xquery.XQExpression createExpression()
           
 javax.xml.xquery.XQExpression createExpression(javax.xml.xquery.XQStaticContext properties)
           
 boolean getAutoCommit()
           
 Configuration getConfiguration()
           
 javax.xml.xquery.XQMetaData getMetaData()
           
 javax.xml.xquery.XQStaticContext getStaticContext()
           
 javax.xml.xquery.XQPreparedExpression prepareExpression(java.io.InputStream xquery)
           
 javax.xml.xquery.XQPreparedExpression prepareExpression(java.io.InputStream xquery, javax.xml.xquery.XQStaticContext properties)
           
 javax.xml.xquery.XQPreparedExpression prepareExpression(java.io.Reader xquery)
           
 javax.xml.xquery.XQPreparedExpression prepareExpression(java.io.Reader xquery, javax.xml.xquery.XQStaticContext properties)
           
 javax.xml.xquery.XQPreparedExpression prepareExpression(java.lang.String xquery)
           
 javax.xml.xquery.XQPreparedExpression prepareExpression(java.lang.String xquery, javax.xml.xquery.XQStaticContext properties)
           
 void rollback()
           
 void setAutoCommit(boolean autoCommit)
           
 void setStaticContext(javax.xml.xquery.XQStaticContext properties)
           
 
Methods inherited from class net.sf.saxon.xqj.SaxonXQDataFactory
createAtomicType, createAtomicType, createAttributeType, createAttributeType, createCommentType, createDocumentElementType, createDocumentSchemaElementType, createDocumentType, createElementType, createElementType, createItem, createItemFromAtomicValue, createItemFromBoolean, createItemFromByte, createItemFromDocument, createItemFromDocument, createItemFromDocument, createItemFromDocument, createItemFromDocument, createItemFromDocument, createItemFromDouble, createItemFromFloat, createItemFromInt, createItemFromLong, createItemFromNode, createItemFromObject, createItemFromShort, createItemFromString, createItemType, createNodeType, createProcessingInstructionType, createSchemaAttributeType, createSchemaElementType, createSequence, createSequence, createSequenceType, createTextType, getObjectConverter, init, mapSaxonTypeToXQJ, setObjectConverter
 
Methods inherited from class net.sf.saxon.xqj.Closable
checkNotClosed, close, isClosed, setClosableContainer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.xml.xquery.XQConnection
close, isClosed
 
Methods inherited from interface javax.xml.xquery.XQDataFactory
createAtomicType, createAtomicType, createAttributeType, createAttributeType, createCommentType, createDocumentElementType, createDocumentSchemaElementType, createDocumentType, createElementType, createElementType, createItem, createItemFromAtomicValue, createItemFromBoolean, createItemFromByte, createItemFromDocument, createItemFromDocument, createItemFromDocument, createItemFromDocument, createItemFromDocument, createItemFromDouble, createItemFromFloat, createItemFromInt, createItemFromLong, createItemFromNode, createItemFromObject, createItemFromShort, createItemFromString, createItemType, createNodeType, createProcessingInstructionType, createSchemaAttributeType, createSchemaElementType, createSequence, createSequence, createSequenceType, createTextType
 

Constructor Detail

SaxonXQConnection

SaxonXQConnection(SaxonXQDataSource dataSource)
Create an SaxonXQConnection from a SaxonXQDataSource

Parameters:
dataSource - the data source.
Method Detail

getConfiguration

public Configuration getConfiguration()
Specified by:
getConfiguration in class SaxonXQDataFactory

commit

public void commit()
            throws javax.xml.xquery.XQException
Specified by:
commit in interface javax.xml.xquery.XQConnection
Throws:
javax.xml.xquery.XQException

createExpression

public javax.xml.xquery.XQExpression createExpression()
                                               throws javax.xml.xquery.XQException
Specified by:
createExpression in interface javax.xml.xquery.XQConnection
Throws:
javax.xml.xquery.XQException

createExpression

public javax.xml.xquery.XQExpression createExpression(javax.xml.xquery.XQStaticContext properties)
                                               throws javax.xml.xquery.XQException
Specified by:
createExpression in interface javax.xml.xquery.XQConnection
Throws:
javax.xml.xquery.XQException

getAutoCommit

public boolean getAutoCommit()
                      throws javax.xml.xquery.XQException
Specified by:
getAutoCommit in interface javax.xml.xquery.XQConnection
Throws:
javax.xml.xquery.XQException

getMetaData

public javax.xml.xquery.XQMetaData getMetaData()
                                        throws javax.xml.xquery.XQException
Specified by:
getMetaData in interface javax.xml.xquery.XQConnection
Throws:
javax.xml.xquery.XQException

getStaticContext

public javax.xml.xquery.XQStaticContext getStaticContext()
                                                  throws javax.xml.xquery.XQException
Specified by:
getStaticContext in interface javax.xml.xquery.XQConnection
Throws:
javax.xml.xquery.XQException

prepareExpression

public javax.xml.xquery.XQPreparedExpression prepareExpression(java.io.InputStream xquery)
                                                        throws javax.xml.xquery.XQException
Specified by:
prepareExpression in interface javax.xml.xquery.XQConnection
Throws:
javax.xml.xquery.XQException

prepareExpression

public javax.xml.xquery.XQPreparedExpression prepareExpression(java.io.InputStream xquery,
                                                               javax.xml.xquery.XQStaticContext properties)
                                                        throws javax.xml.xquery.XQException
Specified by:
prepareExpression in interface javax.xml.xquery.XQConnection
Throws:
javax.xml.xquery.XQException

prepareExpression

public javax.xml.xquery.XQPreparedExpression prepareExpression(java.io.Reader xquery)
                                                        throws javax.xml.xquery.XQException
Specified by:
prepareExpression in interface javax.xml.xquery.XQConnection
Throws:
javax.xml.xquery.XQException

prepareExpression

public javax.xml.xquery.XQPreparedExpression prepareExpression(java.io.Reader xquery,
                                                               javax.xml.xquery.XQStaticContext properties)
                                                        throws javax.xml.xquery.XQException
Specified by:
prepareExpression in interface javax.xml.xquery.XQConnection
Throws:
javax.xml.xquery.XQException

prepareExpression

public javax.xml.xquery.XQPreparedExpression prepareExpression(java.lang.String xquery)
                                                        throws javax.xml.xquery.XQException
Specified by:
prepareExpression in interface javax.xml.xquery.XQConnection
Throws:
javax.xml.xquery.XQException

prepareExpression

public javax.xml.xquery.XQPreparedExpression prepareExpression(java.lang.String xquery,
                                                               javax.xml.xquery.XQStaticContext properties)
                                                        throws javax.xml.xquery.XQException
Specified by:
prepareExpression in interface javax.xml.xquery.XQConnection
Throws:
javax.xml.xquery.XQException

copyPreparedExpression

public javax.xml.xquery.XQPreparedExpression copyPreparedExpression(javax.xml.xquery.XQPreparedExpression expression)
                                                             throws javax.xml.xquery.XQException
Copy a prepared expression to create a new prepared expression. The prepared expression to be copied may belong to a different connection. This method (which is a Saxon extension to the XQJ interface) allows a query to be compiled once, and reused concurrently under multiple connections in multiple threads. The compiled code of the existing query and its static context are shared with the original query, but a new dynamic context is established, so that the two expressions can safely be used in parallel.

Parameters:
expression - the XQPreparedExpression to be copied. This must have been created using Saxon, and it must have been created with an XQConnection derived from the same XQDataSource as this connection.
Returns:
a copy of the supplied expression, that can be used in a different connection or thread with its own dynamic context. The new copy of the expression belongs to this connection, and can be used in the same way as an expression created using any of the prepareExpression() methods on this class.
Throws:
XQException, - for example if either of the connections has been closed
javax.xml.xquery.XQException

rollback

public void rollback()
              throws javax.xml.xquery.XQException
Specified by:
rollback in interface javax.xml.xquery.XQConnection
Throws:
javax.xml.xquery.XQException

setAutoCommit

public void setAutoCommit(boolean autoCommit)
                   throws javax.xml.xquery.XQException
Specified by:
setAutoCommit in interface javax.xml.xquery.XQConnection
Throws:
javax.xml.xquery.XQException

setStaticContext

public void setStaticContext(javax.xml.xquery.XQStaticContext properties)
                      throws javax.xml.xquery.XQException
Specified by:
setStaticContext in interface javax.xml.xquery.XQConnection
Throws:
javax.xml.xquery.XQException