Class PoolDataSourceFactory

java.lang.Object
oracle.ucp.jdbc.PoolDataSourceFactory

public class PoolDataSourceFactory extends Object
Data source factory for creating instances of the pool-enabled PoolDataSource or PoolXADataSource that provide access to Universal Connection Pool functionalities.
  • Constructor Details

    • PoolDataSourceFactory

      public PoolDataSourceFactory()
  • Method Details

    • getPoolDataSource

      public static PoolDataSource getPoolDataSource()
      Obtains a pool-enabled PoolDataSource instance.
      Returns:
      A PoolDataSource instance.
    • getPoolDataSource

      public static PoolDataSource getPoolDataSource(String dataSourceName) throws SQLException
      Obtains a pool-enabled PoolDataSource instance. The location of the XML configuration file is specified using the Java system property "oracle.ucp.jdbc.xmlConfigFile".
      Parameters:
      dataSourceName - name of the data source present in configuration file.
      Returns:
      A PoolDataSource instance.
      Throws:
      SQLException - in case of inability to get a pool data source.
    • getPoolDataSource

      public static PoolDataSource getPoolDataSource(String dataSourceName, InputStream is) throws SQLException
      Obtains a pool-enabled PoolDataSource instance form a given stream.
      Parameters:
      dataSourceName - name of the data source present in configuration file.
      is - input stream from where all config data comes.
      Returns:
      A PoolDataSource instance.
      Throws:
      SQLException - in case of inability to get a pool data source.
    • getPoolDataSource

      public static PoolDataSource getPoolDataSource(Properties configuration) throws SQLException
      Creates and configures a new data source to a shared pool instance. The following properties are supported in the "configuration" parameter: connectionPoolName, dataSourceName, user, password, description, serviceName, pdbRoles.
      Parameters:
      configuration - the configuration input as Properties
      Returns:
      A PoolDataSource instance.
      Throws:
      SQLException - If an error occurs while configuring new data source.
    • getPoolXADataSource

      public static PoolXADataSource getPoolXADataSource()
      Obtains a pool-enabled PoolXADataSource instance.
      Returns:
      A PoolXADataSource instance.
    • getPoolXADataSource

      public static PoolXADataSource getPoolXADataSource(String dataSourceName) throws SQLException
      Obtains a pool-enabled PoolXADataSource instance. The location of the XML configuration file is specified using the Java system property "oracle.ucp.jdbc.xmlConfigFile".
      Parameters:
      dataSourceName - name of the data source present in configuration file.
      Returns:
      A PoolXADataSource instance.
      Throws:
      SQLException - in case of inability to get an XA data source.
    • getPoolXADataSource

      public static PoolXADataSource getPoolXADataSource(Properties configuration) throws SQLException
      Creates and configures a new XA data source to a shared pool instance. The following properties are supported in the "configuration" parameter: connectionPoolName, dataSourceName, user, password, description, serviceName, pdbRoles.
      Parameters:
      configuration - the configuration input as Properties
      Returns:
      A PoolXADataSource instance.
      Throws:
      SQLException - If an error occurs while configuring new XA data source.