Class PoolDataSourceFactory


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

      • PoolDataSourceFactory

        public PoolDataSourceFactory()
    • Method Detail

      • getPoolDataSource

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

        public static PoolDataSource getPoolDataSource​(java.lang.String dataSourceName)
                                                throws java.sql.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:
        java.sql.SQLException - in case of inability to get a pool data source.
      • getPoolDataSource

        public static PoolDataSource getPoolDataSource​(java.lang.String dataSourceName,
                                                       java.io.InputStream is)
                                                throws java.sql.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:
        java.sql.SQLException - in case of inability to get a pool data source.
      • getPoolDataSource

        public static PoolDataSource getPoolDataSource​(java.util.Properties configuration)
                                                throws java.sql.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:
        java.sql.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​(java.lang.String dataSourceName)
                                                    throws java.sql.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:
        java.sql.SQLException - in case of inability to get an XA data source.
      • getPoolXADataSource

        public static PoolXADataSource getPoolXADataSource​(java.util.Properties configuration)
                                                    throws java.sql.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:
        java.sql.SQLException - If an error occurs while configuring new XA data source.