Interface DataSourcePool


public interface DataSourcePool
Combines multiple DataSourcePoolProvider services into a single service that gives access to preconfigured data sources.
  • Method Details

    • getDataSource

      <AdapterType> AdapterType getDataSource(String name, Class<AdapterType> desiredType) throws DataSourceNotFoundException, TypeNotAvailableException
      Return the named data source, if available
      Parameters:
      name - Configured name of the data source
      desiredType - , expected type (for example DataSource.class for a j2ee DataSource).
      Returns:
      a data source object of the desired type, which must be properly closed or disposed of to be returned to the pool, according to the semantics of that data source type.
      Throws:
      DataSourceNotFoundException - no data source found with supplied name.
      TypeNotAvailableException - data source found but not compatible with desired type
    • getDataSource

      Object getDataSource(String name) throws DataSourceNotFoundException
      Return the named data source, if available, as an Object. Useful in scripting languages where the actual type is checked by the language, for other cases it is recommended to use the getDataSource method.
      Parameters:
      name - name of the data source
      Returns:
      the datasource
      Throws:
      DataSourceNotFoundException - if the data source is not found
    • getAllJndiDataSourceNames

      Collection<String> getAllJndiDataSourceNames()
      Return the collection of all JNDI data sources available with the system. Useful for tooling which wants to show all datasources in the system
      Returns:
      Collection of all JNDI Data Sources that are register with this Pool