OsgiDataSourceFactory
This class implements the OSGi DataSourceFactory interface for the H2 JDBC
driver. The following standard configuration properties are supported:
{@link #JDBC_USER}, {@link #JDBC_PASSWORD}, {@link #JDBC_DESCRIPTION},
{@link #JDBC_DATASOURCE_NAME}, {@link #JDBC_NETWORK_PROTOCOL},
{@link #JDBC_URL}, {@link #JDBC_SERVER_NAME}, {@link #JDBC_PORT_NUMBER}. The
following standard configuration properties are not supported:
{@link #JDBC_ROLE_NAME}, {@link #JDBC_DATABASE_NAME},
{@link #JDBC_INITIAL_POOL_SIZE}, {@link #JDBC_MAX_POOL_SIZE},
{@link #JDBC_MIN_POOL_SIZE}, {@link #JDBC_MAX_IDLE_TIME},
{@link #JDBC_MAX_STATEMENTS}, {@link #JDBC_PROPERTY_CYCLE}. Any other
property will be treated as a H2 specific option. If the {@link #JDBC_URL}
property is passed to any of the DataSource factories, the following
properties will be ignored: {@link #JDBC_DATASOURCE_NAME},
{@link #JDBC_NETWORK_PROTOCOL}, {@link #JDBC_SERVER_NAME},
{@link #JDBC_PORT_NUMBER}.
| Methods |
| static void |
registerService(BundleContext bundleContext, Driver driver)
Register the H2 JDBC driver service.
|
| static void |
registerService(BundleContext bundleContext, Driver driver)
Register the H2 JDBC driver service.
Parameters:
bundleContext - the bundle context
driver - the driver
|
| ConnectionPoolDataSource |
createConnectionPoolDataSource(Properties properties)
Creates a pooled data source.
|
| ConnectionPoolDataSource |
createConnectionPoolDataSource(Properties properties) throws SQLException
Creates a pooled data source.
Parameters:
properties - the properties for the data source.
Returns:
a new data source.
Throws:
SQLException - if unsupported properties are supplied, or if data
source can not be created.
|
| DataSource |
createDataSource(Properties properties)
Creates a basic data source.
|
| DataSource |
createDataSource(Properties properties) throws SQLException
Creates a basic data source.
Parameters:
properties - the properties for the data source.
Returns:
a new data source.
Throws:
SQLException - if unsupported properties are supplied, or if data
source can not be created.
|
| Driver |
createDriver(Properties properties)
Returns a driver.
|
| Driver |
createDriver(Properties properties) throws SQLException
Returns a driver. The H2 driver does not support any properties.
Parameters:
properties - must be null or empty list.
Returns:
a driver.
Throws:
SQLException - if any property is supplied.
|
| XADataSource |
createXADataSource(Properties properties)
Creates a pooled XA data source.
|
| XADataSource |
createXADataSource(Properties properties) throws SQLException
Creates a pooled XA data source.
Parameters:
properties - the properties for the data source.
Returns:
a new data source.
Throws:
SQLException - if unsupported properties are supplied, or if data
source can not be created.
|
|