Interface DataSourceFactory


  • public interface DataSourceFactory
    A factory for JDBC connection factories. There are 3 preferred connection factories for getting JDBC connections: javax.sql.DataSource, javax.sql.ConnectionPoolDataSource, and javax.sql.XADataSource. DataSource providers should implement this interface and register it as an OSGi service with the JDBC driver class name in the OSGI_JDBC_DRIVER_CLASS property.
    • Method Detail

      • createDataSource

        javax.sql.DataSource createDataSource​(java.util.Properties props)
                                       throws java.sql.SQLException
        Create a new DataSource using the given properties.
        Parameters:
        props - The properties used to configure the DataSource . null indicates no properties. If the property cannot be set on the DataSource being created then a SQLException must be thrown.
        Returns:
        A configured DataSource.
        Throws:
        java.sql.SQLException - If the DataSource cannot be created.
      • createConnectionPoolDataSource

        javax.sql.ConnectionPoolDataSource createConnectionPoolDataSource​(java.util.Properties props)
                                                                   throws java.sql.SQLException
        Create a new ConnectionPoolDataSource using the given properties.
        Parameters:
        props - The properties used to configure the ConnectionPoolDataSource. null indicates no properties. If the property cannot be set on the ConnectionPoolDataSource being created then a SQLException must be thrown.
        Returns:
        A configured ConnectionPoolDataSource.
        Throws:
        java.sql.SQLException - If the ConnectionPoolDataSource cannot be created.
      • createXADataSource

        javax.sql.XADataSource createXADataSource​(java.util.Properties props)
                                           throws java.sql.SQLException
        Create a new XADataSource using the given properties.
        Parameters:
        props - The properties used to configure the XADataSource. null indicates no properties. If the property cannot be set on the XADataSource being created then a SQLException must be thrown.
        Returns:
        A configured XADataSource.
        Throws:
        java.sql.SQLException - If the XADataSource cannot be created.
      • createDriver

        java.sql.Driver createDriver​(java.util.Properties props)
                              throws java.sql.SQLException
        Create a new Driver using the given properties.
        Parameters:
        props - The properties used to configure the Driver. null indicates no properties. If the property cannot be set on the Driver being created then a SQLException must be thrown.
        Returns:
        A configured Driver.
        Throws:
        java.sql.SQLException - If the Driver cannot be created.