Class Hierarchy    Previous  Next  Index

Class COM.cloudscape.core.DataSourceFactory

java.lang.Object
    |
    +----COM.cloudscape.core.DataSourceFactory

public class DataSourceFactory
extends java.lang.Object
implements javax.naming.spi.ObjectFactory
Copyright © 1998-2000, Informix Software, 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

Constructor Index

 o DataSourceFactory()
 

Method Index

 o getConnectionPoolDataSource()
Get a cloudscape DataSource that produces Connections that participate in connection pooling, that is, connects that can be recycled.
 o getDataSource()
Get a basic cloudscape DataSource that produces standard Connection objects that are not pooled or used in a distributed transaction.
 o getObjectInstance(Object, Name, Context, Hashtable)
Re-Create cloudscape datasource given a reference.
 o getRemoteXADataSource()
Get a cloudscape DataSource that supports distributed transactions under client server mode.
 o getXADataSource()
Get a cloudscape DataSource that supports distrubuted transactions.

Constructor Detail

 o DataSourceFactory
public DataSourceFactory()

Method Detail

 o 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
 o 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
 o getRemoteXADataSource
public static RemoteXaDataSource getRemoteXADataSource()
          Get a cloudscape DataSource that supports distributed transactions under client server mode.
Returns:
RemoteXaDataSource object that extends AbstractDataSource
 o getXADataSource
public static javax.sql.XADataSource getXADataSource() throws java.lang.Exception
          Get a cloudscape DataSource that supports distrubuted transactions.
Returns:
XADataSource object that extends AbstractDataSource
Throws:
java.lang.Exception - if XaDataSource is not in class path.
 o getObjectInstance
public java.lang.Object getObjectInstance(java.lang.Object obj,
                                javax.naming.Name name,
                                javax.naming.Context nameCtx,
                                java.util.Hashtable environment) throws java.lang.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:
java.lang.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    Previous  Next  Index