Package net.sf.saxon.xqj
Class SaxonXQDataSource
- java.lang.Object
-
- net.sf.saxon.xqj.SaxonXQDataFactory
-
- net.sf.saxon.xqj.SaxonXQDataSource
-
- All Implemented Interfaces:
XQDataFactory
,XQDataSource
public class SaxonXQDataSource extends SaxonXQDataFactory implements 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
Constructors Constructor Description SaxonXQDataSource()
Create a SaxonXQDataSource using a default configuration.SaxonXQDataSource(Configuration config)
Create a Saxon XQDataSource with a specific configuration
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description XQCommonHandler
getCommonHandler()
Get the XQCommonHandler in use.Configuration
getConfiguration()
Get the configuration in use.XQConnection
getConnection()
XQConnection
getConnection(java.lang.String username, java.lang.String password)
Get a connection, by supplying a username and password.XQConnection
getConnection(java.sql.Connection con)
Get a connection based on an underlying JDBC connectionint
getLoginTimeout()
java.io.PrintWriter
getLogWriter()
java.lang.String
getProperty(java.lang.String name)
java.lang.String[]
getSupportedPropertyNames()
void
setCommonHandler(XQCommonHandler handler)
void
setLoginTimeout(int seconds)
void
setLogWriter(java.io.PrintWriter out)
void
setProperties(java.util.Properties props)
void
setProperty(java.lang.String name, java.lang.String value)
-
Methods inherited from class net.sf.saxon.xqj.SaxonXQDataFactory
createAtomicItemType, createItem, createItemFromAtomicValue, createItemFromBoolean, createItemFromByte, createItemFromDocument, createItemFromDouble, createItemFromFloat, createItemFromInt, createItemFromLong, createItemFromNode, createItemFromObject, createItemFromShort, createItemType, createItemType, createSequence, createSequence, createSequenceType, mapSaxonTypeToXQJ
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sf.saxon.javax.xml.xquery.XQDataFactory
createAtomicItemType, createItem, createItemFromAtomicValue, createItemFromBoolean, createItemFromByte, createItemFromDocument, createItemFromDouble, createItemFromFloat, createItemFromInt, createItemFromLong, createItemFromNode, createItemFromObject, createItemFromShort, createItemType, createItemType, createSequence, createSequence, createSequenceType
-
-
-
-
Constructor Detail
-
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
public SaxonXQDataSource(Configuration config)
Create a Saxon XQDataSource with a specific configuration- Parameters:
config
- The Saxon configuration to be used
-
-
Method Detail
-
getConfiguration
public Configuration 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:
getConfiguration
in classSaxonXQDataFactory
- Returns:
- the configuration in use.
-
getCommonHandler
public XQCommonHandler 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:
getCommonHandler
in classSaxonXQDataFactory
- Returns:
- the XQCommonHandler in use.
-
getConnection
public XQConnection getConnection() throws XQException
- Specified by:
getConnection
in interfaceXQDataSource
- Throws:
XQException
-
getConnection
public XQConnection getConnection(java.sql.Connection con) throws XQException
Get a connection based on an underlying JDBC connection- Specified by:
getConnection
in 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
public XQConnection getConnection(java.lang.String username, java.lang.String password) throws XQException
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:
getConnection
in interfaceXQDataSource
- Parameters:
username
-password
-- Returns:
- a connection
- Throws:
XQException
-
getLoginTimeout
public int getLoginTimeout()
- Specified by:
getLoginTimeout
in interfaceXQDataSource
-
getLogWriter
public java.io.PrintWriter getLogWriter()
- Specified by:
getLogWriter
in interfaceXQDataSource
-
getProperty
public java.lang.String getProperty(java.lang.String name) throws XQException
- Specified by:
getProperty
in interfaceXQDataSource
- Throws:
XQException
-
getSupportedPropertyNames
public java.lang.String[] getSupportedPropertyNames()
- Specified by:
getSupportedPropertyNames
in interfaceXQDataSource
-
setCommonHandler
public void setCommonHandler(XQCommonHandler handler) throws XQException
- Specified by:
setCommonHandler
in interfaceXQDataSource
- Throws:
XQException
-
setLoginTimeout
public void setLoginTimeout(int seconds) throws XQException
- Specified by:
setLoginTimeout
in interfaceXQDataSource
- Throws:
XQException
-
setLogWriter
public void setLogWriter(java.io.PrintWriter out) throws XQException
- Specified by:
setLogWriter
in interfaceXQDataSource
- Throws:
XQException
-
setProperties
public void setProperties(java.util.Properties props) throws XQException
- Specified by:
setProperties
in interfaceXQDataSource
- Throws:
XQException
-
setProperty
public void setProperty(java.lang.String name, java.lang.String value) throws XQException
- Specified by:
setProperty
in interfaceXQDataSource
- Throws:
XQException
-
-