net.sf.saxon.xqj

Class SaxonXQDataSource

Implemented Interfaces:
XQDataSource

public class SaxonXQDataSource
extends java.lang.Object
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

SaxonXQDataSource()
Create a SaxonXQDataSource using a default configuration.
SaxonXQDataSource(Configuration config)
Create a Saxon XQDataSource with a specific configuration

Method Summary

Configuration
getConfiguration()
Get the configuration in use.
XQConnection
getConnection()
XQConnection
getConnection(Connection con)
Get a connection based on an underlying JDBC connection
XQConnection
getConnection(String username, String password)
Get a connection, by supplying a username and password.
PrintWriter
getLogWriter()
int
getLoginTimeout()
String
getProperty(String name)
String[]
getSupportedPropertyNames()
void
setLogWriter(PrintWriter out)
void
setLoginTimeout(int seconds)
void
setProperties(Properties props)
void
setProperty(String name, String value)

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

public SaxonXQDataSource(Configuration config)
Create a Saxon XQDataSource with a specific configuration
Parameters:
config - The Saxon configuration to be used

Method Details

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).
Returns:
the configuration in use.

getConnection

public XQConnection getConnection()
            throws XQException
Specified by:
getConnection in interface XQDataSource

getConnection

public XQConnection getConnection(Connection con)
            throws XQException
Get a connection based on an underlying JDBC connection
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(String username,
                                  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 interface XQDataSource
Parameters:
username -
password -
Returns:
a connection
Throws:
XQException -

getLogWriter

public PrintWriter getLogWriter()
Specified by:
getLogWriter in interface XQDataSource

getLoginTimeout

public int getLoginTimeout()
Specified by:
getLoginTimeout in interface XQDataSource

getProperty

public String getProperty(String name)
            throws XQException
Specified by:
getProperty in interface XQDataSource

getSupportedPropertyNames

public String[] getSupportedPropertyNames()
Specified by:
getSupportedPropertyNames in interface XQDataSource

setLogWriter

public void setLogWriter(PrintWriter out)
            throws XQException
Specified by:
setLogWriter in interface XQDataSource

setLoginTimeout

public void setLoginTimeout(int seconds)
            throws XQException
Specified by:
setLoginTimeout in interface XQDataSource

setProperties

public void setProperties(Properties props)
            throws XQException
Specified by:
setProperties in interface XQDataSource

setProperty

public void setProperty(String name,
                        String value)
            throws XQException
Specified by:
setProperty in interface XQDataSource