org.xquark.extractor
Class ExtractorConnection

java.lang.Object
  |
  +--org.xquark.xml.xdbc.DefaultReadOnlyXMLConnection
        |
        +--org.xquark.extractor.ExtractorConnection
All Implemented Interfaces:
XMLConnection

public class ExtractorConnection
extends DefaultReadOnlyXMLConnection
implements XMLConnection

Extractor implementation of XMLConnection.


Field Summary
 
Fields inherited from interface org.xquark.xml.xdbc.XMLConnection
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE, XPATH_STRING_TYPE, XQUERY_STRING_TYPE
 
Method Summary
 void close()
          To close the current data source connection.
 void commit()
          Makes all changes made since the previous commit/rollback permanent and releases any data source locks currently held by the Connection.
 XMLStatement createStatement()
          Creates a statement object for sending XQuery (query type by default) statements to the data source.
 XMLStatement createStatement(short queryType)
          Creates a statement object for sending XQuery or XPath (according to the specified type) statements to the data source.
protected  void finalize()
           
 Extractor getExtractor()
           
 java.sql.Connection getJdbcConnection()
           
 XMLDataSourceMetaData getMetaData()
          Gets the metadata regarding this connection's data source.
 XMLDataSourceMetaData getMetaData(boolean refresh)
          Gets the metadata regarding this connection's data source.
 java.lang.String getURL()
          To get the current URL of this connection.
 java.lang.String getUserName()
          To get the current user name.
 boolean isClosed()
          To know the connection state (opened or closed).
 void loadModule(java.lang.String moduleURL)
           
 void loadSchema(org.xml.sax.InputSource source)
           
 PreparedXMLStatement prepareStatement(java.lang.String query)
          Creates a prepared statement object for sending parameterized XQuery (query type by default) statements to the data source.
 void setBaseURI(java.lang.String baseURI)
          Sets the base URI for documents.
 void statementClosed(XMLStatement closedStatement)
           
 
Methods inherited from class org.xquark.xml.xdbc.DefaultReadOnlyXMLConnection
createCollection, createCollectionConfig, deleteAllCollections, deleteCollection, getAutoCommit, getCollection, getTransactionIsolation, isReadOnly, renameCollection, rollback, setAutoCommit, setReadOnly, setTransactionIsolation
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.xquark.xml.xdbc.XMLConnection
createCollection, createCollectionConfig, deleteAllCollections, deleteCollection, getAutoCommit, getCollection, getTransactionIsolation, isReadOnly, renameCollection, rollback, setAutoCommit, setReadOnly, setTransactionIsolation
 

Method Detail

getJdbcConnection

public java.sql.Connection getJdbcConnection()

getExtractor

public Extractor getExtractor()

close

public void close()
           throws XMLDBCException
Description copied from interface: XMLConnection
To close the current data source connection.

Specified by:
close in interface XMLConnection
Throws:
XMLDBCException - if a data source access error occurs.

commit

public void commit()
            throws XMLDBCException,
                   XMLDBCNotSupportedException
Description copied from interface: XMLConnection
Makes all changes made since the previous commit/rollback permanent and releases any data source locks currently held by the Connection. This method has no effect when auto-commit mode has been enabled.

Specified by:
commit in interface XMLConnection
Overrides:
commit in class DefaultReadOnlyXMLConnection
Throws:
XMLDBCNotSupportedException - if the data source does not support transactions
XMLDBCException - if a data source access error occurs.

isClosed

public boolean isClosed()
                 throws XMLDBCException
Description copied from interface: XMLConnection
To know the connection state (opened or closed).

Specified by:
isClosed in interface XMLConnection
Returns:
true if the current connection is closed, else false.
Throws:
XMLDBCException - if a data source access error occurs.

getUserName

public java.lang.String getUserName()
                             throws XMLDBCException
Description copied from interface: XMLConnection
To get the current user name.

Specified by:
getUserName in interface XMLConnection
Returns:
the current user name.
Throws:
XMLDBCException - if a data source access error occurs.

getURL

public java.lang.String getURL()
                        throws XMLDBCException
Description copied from interface: XMLConnection
To get the current URL of this connection.

Specified by:
getURL in interface XMLConnection
Returns:
the current URL of this connection.
Throws:
XMLDBCException - if a data source access error occurs.

createStatement

public XMLStatement createStatement(short queryType)
                             throws XMLDBCException
Description copied from interface: XMLConnection
Creates a statement object for sending XQuery or XPath (according to the specified type) statements to the data source.

Specified by:
createStatement in interface XMLConnection
Parameters:
queryType - the type of query for this statement (see constants in this interface).
Returns:
a new statement.
Throws:
XMLDBCException - if a data source access error occurs.

createStatement

public XMLStatement createStatement()
                             throws XMLDBCException
Description copied from interface: XMLConnection
Creates a statement object for sending XQuery (query type by default) statements to the data source.

Specified by:
createStatement in interface XMLConnection
Returns:
a new statement.
Throws:
XMLDBCException - if a data source access error occurs.

prepareStatement

public PreparedXMLStatement prepareStatement(java.lang.String query)
                                      throws XMLDBCException,
                                             XMLDBCNotSupportedException
Description copied from interface: XMLConnection
Creates a prepared statement object for sending parameterized XQuery (query type by default) statements to the data source. The advantage of prepared statements over statements is that the request may be precompiled once and executed several times. Note: this interface is optional.

Specified by:
prepareStatement in interface XMLConnection
Parameters:
query - a parameterized XQuery.
Returns:
a new prepared statement containing the pre-compiled statement.
Throws:
XMLDBCException - if a data source access error occurs.
XMLDBCNotSupportedException - if the method is not supported.

getMetaData

public XMLDataSourceMetaData getMetaData()
                                  throws XMLDBCException
Gets the metadata regarding this connection's data source. A connection's data source is able to provide information describing itself.

Specified by:
getMetaData in interface XMLConnection
Returns:
an XMLDataSourceMetaData object for this connection.
Throws:
XMLDBCException - if a data source access error occurs.

getMetaData

public XMLDataSourceMetaData getMetaData(boolean refresh)
                                  throws XMLDBCException
Description copied from interface: XMLConnection
Gets the metadata regarding this connection's data source. A connection's data source is able to provide information describing itself.

Specified by:
getMetaData in interface XMLConnection
Parameters:
refresh - if true, reload metadata.
Returns:
an XMLDataSourceMetaData object for this connection.
Throws:
XMLDBCException - if a data source access error occurs.

statementClosed

public void statementClosed(XMLStatement closedStatement)
                     throws XMLDBCException
XMLDBCException

finalize

protected void finalize()
                 throws java.lang.Exception
Overrides:
finalize in class java.lang.Object
java.lang.Exception

loadModule

public void loadModule(java.lang.String moduleURL)
                throws XMLDBCException
XMLDBCException

loadSchema

public void loadSchema(org.xml.sax.InputSource source)
                throws org.xml.sax.SAXException,
                       XMLDBCException
org.xml.sax.SAXException
XMLDBCException

setBaseURI

public void setBaseURI(java.lang.String baseURI)
Sets the base URI for documents.

Specified by:
setBaseURI in interface XMLConnection
Returns:
nothing


Copyright © 2004 Université de Versailles Saint-Quentin, XQuark Group. All rights reserved.