com.ibm.websphere.rsadapter

Interface WSDataSource

All Superinterfaces:
javax.sql.CommonDataSource, javax.sql.DataSource, java.sql.Wrapper

  1. public interface WSDataSource
  2. extends javax.sql.DataSource
Interface for data sources that are managed by WebSphere Application Server. This interface enables an application to provide additional parameters when requesting a Connection. These parameters are provided in a ConnectionSpec object.

Field Summary

Modifier and Type Field and Description
  1. static
  2. int
ERROR_CONNECTION_POOL_IS_PAUSED
Error code for SQLException that indicates that the connection pool is paused.
  1. static
  2. java.lang.String
IMMEDIATE_PURGE
With the IMMEDIATE_PURGE option, the purged pool will behave as follows after the purge call: No new transactions will be allowed to start on any connections obtained prior to the purgePoolContents() call.
  1. static
  2. java.lang.String
NORMAL_PURGE
With the NORMAL_PURGE option, the purged pool will behave as follows after the purge call: Existing in-flight transactions will be allowed to continue work Shared connection requests will be honored Free connections are cleanup and destroyed In use connection (i.e. connections in transactions) are cleanup and destroyed when returned to the connection pool close() calls issued on any connections obtained prior to the purgePool call will be done synchronously (i.e. wait for the jdbc driver to come back before proceeding) Requests for new connections (not handles to existing old connections) will be honored.

Method Summary

Modifier and Type Method and Description
  1. java.sql.Connection
getConnection(JDBCConnectionSpec connSpec)
Obtains a Connection based on the information provided in the JDBCConnectionSpec object.
  1. java.sql.Connection
getConnection(WSCciConnectionSpec connSpec)
Deprecated. This method is not supported. Obtains a Connection based on the information provided in the WSConnectionSpec object. This method is provided solely for the WebSphere CCI layer, or other implementors of the javax.resource.cci interfaces. The WebSphere CCI layer will always delegate to this method. This method should never be used directly by customer applications.
  1. boolean
isXADataSource()
Indicates whether or not the underlying data source is an XADataSource, capbable of two phase commit.
Methods inherited from interface javax.sql.DataSource
getConnection, getConnection
Methods inherited from interface javax.sql.CommonDataSource
getLoginTimeout, getLogWriter, setLoginTimeout, setLogWriter
Methods inherited from interface java.sql.Wrapper
isWrapperFor, unwrap

Field Detail

ERROR_CONNECTION_POOL_IS_PAUSED

  1. static final int ERROR_CONNECTION_POOL_IS_PAUSED
Error code for SQLException that indicates that the connection pool is paused.
See Also:

NORMAL_PURGE

  1. static final java.lang.String NORMAL_PURGE
With the NORMAL_PURGE option, the purged pool will behave as follows after the purge call:
  1. Existing in-flight transactions will be allowed to continue work
  2. Shared connection requests will be honored
  3. Free connections are cleanup and destroyed
  4. In use connection (i.e. connections in transactions) are cleanup and destroyed when returned to the connection pool
  5. close() calls issued on any connections obtained prior to the purgePool call will be done synchronously (i.e. wait for the jdbc driver to come back before proceeding)
  6. Requests for new connections (not handles to existing old connections) will be honored.
See Also:

IMMEDIATE_PURGE

  1. static final java.lang.String IMMEDIATE_PURGE
With the IMMEDIATE_PURGE option, the purged pool will behave as follows after the purge call:
  1. No new transactions will be allowed to start on any connections obtained prior to the purgePoolContents() call. Instead, a StaleConnectionException is thrown
  2. No new handles are allowed to be handed out on any connections obtained prior to the purgePoolContents() call. Instead, a StaleConnectionException is thrown
  3. Existing in-flight transactions will be allowed to continue work, any new activities on the purgedConnection will cause a StaleConnectionException or an XAER_FAIL exception
  4. close() calls issued on any connections obtained prior to the purgePoolContents() call will be done asynchronously (i.e. no wait time)
  5. Requests for new connections (i.e. not handles to existing old connections) will be honored.
  6. Number of connections will be decremented immediately. This may cause the total number of connections in WebSphere to be, temporarily, out of sync with the database total number of connections
See Also:

Method Detail

getConnection

  1. java.sql.Connection getConnection( JDBCConnectionSpec connSpec)
  2. throws java.sql.SQLException
Obtains a Connection based on the information provided in the JDBCConnectionSpec object. This method is provided to give JDBC applications a mechanism for specifying the catalog, isReadOnly, typeMap, and cursor holdability Connection properties. This allows the underlying Connection to be shared based on the above criteria.
Parameters:
connSpec - information used to establish the Connection, such as user name, password, and type map. This value should never be null.
Returns:
the Connection
Throws:
java.sql.SQLException - if an error occurs while obtaining a Connection.

getConnection

  1. java.sql.Connection getConnection( WSCciConnectionSpec connSpec)
  2. throws java.sql.SQLException
Deprecated. This method is not supported. Obtains a Connection based on the information provided in the WSConnectionSpec object. This method is provided solely for the WebSphere CCI layer, or other implementors of the javax.resource.cci interfaces. The WebSphere CCI layer will always delegate to this method. This method should never be used directly by customer applications.
Parameters:
connSpec - information used to establish the Connection, such as user name, password, and AccessIntent. This value should never be null, however, an empty WSConnectionSpec may be used instead.
Returns:
the Connection
Throws:
java.sql.SQLException - if an error occurs while obtaining a Connection.

isXADataSource

  1. boolean isXADataSource()
Indicates whether or not the underlying data source is an XADataSource, capbable of two phase commit.
Returns:
true if the underlying data source is an XADataSource, capable of two phase commit, otherwise false.