Class Hierarchy Index
Class COM.cloudscape.core.DataSourceFactory
java.lang.Object
|
+----COM.cloudscape.core.DataSourceFactory
- public class DataSourceFactory
- extends Object
- implements ObjectFactory
Copyright © 1998-1999, Cloudscape, Inc. All rights reserved.
This is a factory for Cloudscape data sources. Data source is a
JDBC2.0 extension interface. This class should only be used if one is
running with java version 2 or later, with JTA and has JDBC 2.0 extension
in the CLASSPATH. I.e., javax.sql.* and javax.transaction.xa.*.
All cloudscape data source objects implement JNDI referenceable API and
serializable API. New Data Source objects can be created, typically by a
system administrator, using DataSourceFactory static methods. To use these
DataSources, their appropriate data source properties must be set. See
examples in AbstractDataSource.
A Data Source can be registered with a JNDI server and unmarshalled
using the DataSourceFactory.getObjectInstance call. Or, a Data Source
object can be stored in its serialized form and then objectified directly.
All cloudscape data source objects extend AbstractDataSource, which
defines all these properties. To see the list of properties that can be
set on a Cloudscape data source, and examples on how to set them, see
AbstractDataSource.
- See Also:
- AbstractDataSource, BasicDataSource, LocalConnectionPoolDataSource, XaDataSource
-
DataSourceFactory()
-
-
getConnectionPoolDataSource()
- Get a cloudscape DataSource that produces Connections that participate in
connection pooling, that is, connects that can be recycled.
-
getDataSource()
- Get a basic cloudscape DataSource that produces standard Connection
objects that are not pooled or used in a distributed transaction.
-
getObjectInstance(Object, Name, Context, Hashtable)
- Re-Create cloudscape datasource given a reference.
-
getXADataSource()
- Get a cloudscape DataSource that supports distrubuted transactions.
DataSourceFactory
public DataSourceFactory()
getDataSource
public static BasicDataSource getDataSource()
- Get a basic cloudscape DataSource that produces standard Connection
objects that are not pooled or used in a distributed transaction.
- Returns:
- DataSource object that extends AbstractDataSource
getConnectionPoolDataSource
public static LocalConnectionPoolDataSource getConnectionPoolDataSource()
- Get a cloudscape DataSource that produces Connections that participate in
connection pooling, that is, connects that can be recycled.
- Returns:
- ConnectionPoolDataSource object that extends AbstractDataSource
getXADataSource
public static XADataSource getXADataSource() throws Exception
- Get a cloudscape DataSource that supports distrubuted transactions.
- Returns:
- XADataSource object that extends AbstractDataSource
- Throws: Exception
- if XaDataSource is not in class path.
getObjectInstance
public Object getObjectInstance(Object obj,
Name name,
Context nameCtx,
Hashtable environment) throws Exception
- Re-Create cloudscape datasource given a reference.
- Parameters:
- obj - The possibly null object containing location or reference
information that can be used in creating an object.
- name - The name of this object relative to nameCtx, or null if no
name is specified.
- nameCtx - The context relative to which the name parameter is
specified, or null if name is relative to the default initial context.
- environment - The possibly null environment that is used in
creating the object.
- Throws: Exception
- if this object factory encountered an exception
while attempting to create an object, and no other object factories are
to be tried.
Class Hierarchy Index