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.
"ThreadSafe"
  • Field Details

  • Method Details

    • createDataSource

      DataSource createDataSource(Properties props) throws 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:
      SQLException - If the DataSource cannot be created.
    • createConnectionPoolDataSource

      ConnectionPoolDataSource createConnectionPoolDataSource(Properties props) throws 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:
      SQLException - If the ConnectionPoolDataSource cannot be created.
    • createXADataSource

      XADataSource createXADataSource(Properties props) throws 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:
      SQLException - If the XADataSource cannot be created.
    • createDriver

      Driver createDriver(Properties props) throws 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:
      SQLException - If the Driver cannot be created.