Class SaxonXQDataSource
java.lang.Object
net.sf.saxon.xqj.SaxonXQDataFactory
net.sf.saxon.xqj.SaxonXQDataSource
- All Implemented Interfaces:
XQDataFactory, XQDataSource
Saxon implementation of the XQJ XQDataSource interface. The first action of a client application
is to instantiate a SaxonXQDataSource. This is done directly: there is no factory class as with JAXP.
An application that does not want compile-time references to the Saxon XQJ implementation can instantiate
this class dynamically using the reflection API (class.newInstance()).
For full Javadoc descriptions of the public methods, see the XQJ specification.
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a SaxonXQDataSource using a default configuration.SaxonXQDataSource(Configuration config) Create a Saxon XQDataSource with a specific configuration -
Method Summary
Modifier and TypeMethodDescriptionGet the XQCommonHandler in use.Get the configuration in use.getConnection(String username, String password) Get a connection, by supplying a username and password.getConnection(Connection con) Get a connection based on an underlying JDBC connectionintgetProperty(String name) String[]voidsetCommonHandler(XQCommonHandler handler) voidsetLoginTimeout(int seconds) voidsetLogWriter(PrintWriter out) voidsetProperties(Properties props) voidsetProperty(String name, String value) Methods inherited from class SaxonXQDataFactory
createAtomicItemType, createItem, createItemFromAtomicValue, createItemFromBoolean, createItemFromByte, createItemFromDocument, createItemFromDouble, createItemFromFloat, createItemFromInt, createItemFromLong, createItemFromNode, createItemFromObject, createItemFromShort, createItemType, createItemType, createSequence, createSequence, createSequenceType, mapSaxonTypeToXQJMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface XQDataFactory
createAtomicItemType, createItem, createItemFromAtomicValue, createItemFromBoolean, createItemFromByte, createItemFromDocument, createItemFromDouble, createItemFromFloat, createItemFromInt, createItemFromLong, createItemFromNode, createItemFromObject, createItemFromShort, createItemType, createItemType, createSequence, createSequence, createSequenceType
-
Constructor Details
-
SaxonXQDataSource
public SaxonXQDataSource()Create a SaxonXQDataSource using a default configuration. A schema-aware configuration will be created if Saxon-SA can be loaded from the classpath; otherwise a basic (non-schema-aware) configuration is created -
SaxonXQDataSource
Create a Saxon XQDataSource with a specific configuration- Parameters:
config- The Saxon configuration to be used
-
-
Method Details
-
getConfiguration
Get the configuration in use. Changes made to this configuration will affect this data source and XQJ connections created from it (either before or afterwards).- Specified by:
getConfigurationin classSaxonXQDataFactory- Returns:
- the configuration in use.
-
getCommonHandler
Get the XQCommonHandler in use. This controls the mapping between XPath data types and Java types. If no XQCommonHandler has been supplied explicitly, a default handler is used, which implements the default mappings as defined in the XQJ specification.- Specified by:
getCommonHandlerin classSaxonXQDataFactory- Returns:
- the XQCommonHandler in use.
-
getConnection
- Specified by:
getConnectionin interfaceXQDataSource- Throws:
XQException
-
getConnection
Get a connection based on an underlying JDBC connection- Specified by:
getConnectionin interfaceXQDataSource- Parameters:
con- the JDBC connection- Returns:
- a connection based on an underlying JDBC connection
- Throws:
XQException- The Saxon implementation of this method always throws an XQException, indicating that Saxon does not support connection to a JDBC data source.
-
getConnection
Get a connection, by supplying a username and password. The Saxon implementation of this is equivalent to the default constructor: the username and password are ignored.- Specified by:
getConnectionin interfaceXQDataSource- Parameters:
username-password-- Returns:
- a connection
- Throws:
XQException
-
getLoginTimeout
public int getLoginTimeout()- Specified by:
getLoginTimeoutin interfaceXQDataSource
-
getLogWriter
- Specified by:
getLogWriterin interfaceXQDataSource
-
getProperty
- Specified by:
getPropertyin interfaceXQDataSource- Throws:
XQException
-
getSupportedPropertyNames
- Specified by:
getSupportedPropertyNamesin interfaceXQDataSource
-
setCommonHandler
- Specified by:
setCommonHandlerin interfaceXQDataSource- Throws:
XQException
-
setLoginTimeout
- Specified by:
setLoginTimeoutin interfaceXQDataSource- Throws:
XQException
-
setLogWriter
- Specified by:
setLogWriterin interfaceXQDataSource- Throws:
XQException
-
setProperties
- Specified by:
setPropertiesin interfaceXQDataSource- Throws:
XQException
-
setProperty
- Specified by:
setPropertyin interfaceXQDataSource- Throws:
XQException
-