uk.co.lakesidetech.springxmldb.datasource
Interface XMLDBDataSource

All Known Implementing Classes:
BasicXMLDBDataSource, PoolingXMLDBDataSource

public interface XMLDBDataSource

Defines a XMLDBDatSource interface for datasources to XML databases. The interface is similar to a standard javax.sql.DataSource except that as XML:DB apis require connections to each collection seperately in a XML database the usual method of getting a connection is to supply the collection path to get a connection to.

Author:
Stuart Eccles

Method Summary
 org.xmldb.api.base.Collection getCollection()
          Return a XML:DB Collection connection to the XML:DB database.
 org.xmldb.api.base.Collection getCollection(java.lang.String collectionPath)
          Return a XML:DB Collection connection to the XML:DB database for a specified collection given the collection path.
 org.xmldb.api.base.Collection getCollection(java.lang.String username, java.lang.String password, java.lang.String collectionPath)
          Return a XML:DB Collection connection to the XML:DB database for a specified collection given the collection path and user connection details username and password
 

Method Detail

getCollection

public org.xmldb.api.base.Collection getCollection()
                                            throws org.xmldb.api.base.XMLDBException
Return a XML:DB Collection connection to the XML:DB database. This should return a connection to the default set collection for a database. In most cases this would be the root collection /db

Returns:
an XML:DB Collection object
Throws:
org.xmldb.api.base.XMLDBException - if the collection can not be obtained

getCollection

public org.xmldb.api.base.Collection getCollection(java.lang.String collectionPath)
                                            throws org.xmldb.api.base.XMLDBException
Return a XML:DB Collection connection to the XML:DB database for a specified collection given the collection path.

Parameters:
collectionPath - the full collection path to the collection to get for. i.e. /db/plays/shakespeare
Returns:
an XML:DB Collection object
Throws:
org.xmldb.api.base.XMLDBException

getCollection

public org.xmldb.api.base.Collection getCollection(java.lang.String username,
                                                   java.lang.String password,
                                                   java.lang.String collectionPath)
                                            throws org.xmldb.api.base.XMLDBException
Return a XML:DB Collection connection to the XML:DB database for a specified collection given the collection path and user connection details username and password

Parameters:
username - the connection username
password - the connection password
collectionPath -
Returns:
an XML:DB Collection object
Throws:
org.xmldb.api.base.XMLDBException - if the collection can not be obtained