Top Description Fields Methods
org.osgi.service.jdbc

public Interface DataSourceFactory

Imports
java.sql.Driver, .SQLException, java.util.Properties, javax.sql.ConnectionPoolDataSource, .DataSource, .XADataSource

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.
Author
$Id: 839a17795954ba5d1606b55b1512a231d65a5289 $

Field Summary

Modifier and TypeField and Description
public static final String
JDBC_DATABASE_NAME

The "databaseName" property that DataSource clients should supply a value for when calling createDataSource(Properties).

public static final String
JDBC_DATASOURCE_NAME

The "dataSourceName" property that DataSource clients should supply a value for when calling createDataSource(Properties).

public static final String
JDBC_DESCRIPTION

The "description" property that DataSource clients should supply a value for when calling createDataSource(Properties).

public static final String
JDBC_INITIAL_POOL_SIZE

The "initialPoolSize" property that ConnectionPoolDataSource and XADataSource clients may supply a value for when calling createConnectionPoolDataSource(Properties) or createXADataSource(Properties) on drivers that support this property.

public static final String
JDBC_MAX_IDLE_TIME

The "maxIdleTime" property that ConnectionPoolDataSource and XADataSource clients may supply a value for when calling createConnectionPoolDataSource(Properties) or createXADataSource(Properties) on drivers that support this property.

public static final String
JDBC_MAX_POOL_SIZE

The "maxPoolSize" property that ConnectionPoolDataSource and XADataSource clients may supply a value for when calling createConnectionPoolDataSource(Properties) or createXADataSource(Properties) on drivers that support this property.

public static final String
JDBC_MAX_STATEMENTS

The "maxStatements" property that ConnectionPoolDataSource and XADataSource clients may supply a value for when calling createConnectionPoolDataSource(Properties) or createXADataSource(Properties) on drivers that support this property.

public static final String
JDBC_MIN_POOL_SIZE

The "minPoolSize" property that ConnectionPoolDataSource and XADataSource clients may supply a value for when calling createConnectionPoolDataSource(Properties) or createXADataSource(Properties) on drivers that support this property.

public static final String
JDBC_NETWORK_PROTOCOL

The "networkProtocol" property that DataSource clients should supply a value for when calling createDataSource(Properties).

public static final String
JDBC_PASSWORD

The "password" property that DataSource clients should supply a value for when calling createDataSource(Properties).

public static final String
JDBC_PORT_NUMBER

The "portNumber" property that DataSource clients should supply a value for when calling createDataSource(Properties).

public static final String
JDBC_PROPERTY_CYCLE

The "propertyCycle" property that ConnectionPoolDataSource and XADataSource clients may supply a value for when calling createConnectionPoolDataSource(Properties) or createXADataSource(Properties) on drivers that support this property.

public static final String
JDBC_ROLE_NAME

The "roleName" property that DataSource clients should supply a value for when calling createDataSource(Properties).

public static final String
JDBC_SERVER_NAME

The "serverName" property that DataSource clients should supply a value for when calling createDataSource(Properties).

public static final String
JDBC_URL

The "url" property that DataSource clients should supply a value for when calling createDataSource(Properties).

public static final String
JDBC_USER

The "user" property that DataSource clients should supply a value for when calling createDataSource(Properties).

public static final String
OSGI_JDBC_CAPABILITY

Service property used by a DataSourceFactory to declare the capabilities when registering a JDBC DataSourceFactory service.

public static final String
OSGI_JDBC_CAPABILITY_CONNECTIONPOOLDATASOURCE

OSGI_JDBC_CAPABILITY service property which indicates that the DataSourceFactory is able to provide a ConnectionPoolDataSource invoking the createConnectionPoolDataSource(Properties props) method.

public static final String
OSGI_JDBC_CAPABILITY_DATASOURCE

OSGI_JDBC_CAPABILITY service property which indicates that the DataSourceFactory is able to provide a DataSource invoking the createDataSource(Properties props) method.

public static final String
OSGI_JDBC_CAPABILITY_DRIVER

OSGI_JDBC_CAPABILITY service property which indicates that the DataSourceFactory is able to provide a Driver invoking the createDriver(Properties props) method.

public static final String
OSGI_JDBC_CAPABILITY_XADATASOURCE

OSGI_JDBC_CAPABILITY service property which indicates that the DataSourceFactory is able to provide a XADataSource invoking the createXADataSource(Properties props) method.

public static final String
OSGI_JDBC_DRIVER_CLASS

Service property used by a JDBC driver to declare the driver class when registering a JDBC DataSourceFactory service.

public static final String
OSGI_JDBC_DRIVER_NAME

Service property used by a JDBC driver to declare the driver name when registering a JDBC DataSourceFactory service.

public static final String
OSGI_JDBC_DRIVER_VERSION

Service property used by a JDBC driver to declare the driver version when registering a JDBC DataSourceFactory service.

Method Summary

Modifier and TypeMethod and Description
public ConnectionPoolDataSource

Returns:

A configured ConnectionPoolDataSource.
createConnectionPoolDataSource
(Properties
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.
props
)

Create a new ConnectionPoolDataSource using the given properties.

public DataSource

Returns:

A configured DataSource.
createDataSource
(Properties
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.
props
)

Create a new DataSource using the given properties.

public Driver

Returns:

A configured Driver.
createDriver
(Properties
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.
props
)

Create a new Driver using the given properties.

public XADataSource

Returns:

A configured XADataSource.
createXADataSource
(Properties
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.
props
)

Create a new XADataSource using the given properties.

Field Detail

JDBC_DATABASE_NAMEback to summary
public static final String JDBC_DATABASE_NAME

The "databaseName" property that DataSource clients should supply a value for when calling createDataSource(Properties).

JDBC_DATASOURCE_NAMEback to summary
public static final String JDBC_DATASOURCE_NAME

The "dataSourceName" property that DataSource clients should supply a value for when calling createDataSource(Properties).

JDBC_DESCRIPTIONback to summary
public static final String JDBC_DESCRIPTION

The "description" property that DataSource clients should supply a value for when calling createDataSource(Properties).

JDBC_INITIAL_POOL_SIZEback to summary
public static final String JDBC_INITIAL_POOL_SIZE

The "initialPoolSize" property that ConnectionPoolDataSource and XADataSource clients may supply a value for when calling createConnectionPoolDataSource(Properties) or createXADataSource(Properties) on drivers that support this property.

JDBC_MAX_IDLE_TIMEback to summary
public static final String JDBC_MAX_IDLE_TIME

The "maxIdleTime" property that ConnectionPoolDataSource and XADataSource clients may supply a value for when calling createConnectionPoolDataSource(Properties) or createXADataSource(Properties) on drivers that support this property.

JDBC_MAX_POOL_SIZEback to summary
public static final String JDBC_MAX_POOL_SIZE

The "maxPoolSize" property that ConnectionPoolDataSource and XADataSource clients may supply a value for when calling createConnectionPoolDataSource(Properties) or createXADataSource(Properties) on drivers that support this property.

JDBC_MAX_STATEMENTSback to summary
public static final String JDBC_MAX_STATEMENTS

The "maxStatements" property that ConnectionPoolDataSource and XADataSource clients may supply a value for when calling createConnectionPoolDataSource(Properties) or createXADataSource(Properties) on drivers that support this property.

JDBC_MIN_POOL_SIZEback to summary
public static final String JDBC_MIN_POOL_SIZE

The "minPoolSize" property that ConnectionPoolDataSource and XADataSource clients may supply a value for when calling createConnectionPoolDataSource(Properties) or createXADataSource(Properties) on drivers that support this property.

JDBC_NETWORK_PROTOCOLback to summary
public static final String JDBC_NETWORK_PROTOCOL

The "networkProtocol" property that DataSource clients should supply a value for when calling createDataSource(Properties).

JDBC_PASSWORDback to summary
public static final String JDBC_PASSWORD

The "password" property that DataSource clients should supply a value for when calling createDataSource(Properties).

JDBC_PORT_NUMBERback to summary
public static final String JDBC_PORT_NUMBER

The "portNumber" property that DataSource clients should supply a value for when calling createDataSource(Properties).

JDBC_PROPERTY_CYCLEback to summary
public static final String JDBC_PROPERTY_CYCLE

The "propertyCycle" property that ConnectionPoolDataSource and XADataSource clients may supply a value for when calling createConnectionPoolDataSource(Properties) or createXADataSource(Properties) on drivers that support this property.

JDBC_ROLE_NAMEback to summary
public static final String JDBC_ROLE_NAME

The "roleName" property that DataSource clients should supply a value for when calling createDataSource(Properties).

JDBC_SERVER_NAMEback to summary
public static final String JDBC_SERVER_NAME

The "serverName" property that DataSource clients should supply a value for when calling createDataSource(Properties).

JDBC_URLback to summary
public static final String JDBC_URL

The "url" property that DataSource clients should supply a value for when calling createDataSource(Properties).

JDBC_USERback to summary
public static final String JDBC_USER

The "user" property that DataSource clients should supply a value for when calling createDataSource(Properties).

OSGI_JDBC_CAPABILITYback to summary
public static final String OSGI_JDBC_CAPABILITY

Service property used by a DataSourceFactory to declare the capabilities when registering a JDBC DataSourceFactory service. Clients may filter or test this property to determine if the create method can be used. The type of this service property is String+

Since
1.1
OSGI_JDBC_CAPABILITY_CONNECTIONPOOLDATASOURCEback to summary
public static final String OSGI_JDBC_CAPABILITY_CONNECTIONPOOLDATASOURCE

OSGI_JDBC_CAPABILITY service property which indicates that the DataSourceFactory is able to provide a ConnectionPoolDataSource invoking the createConnectionPoolDataSource(Properties props) method.

Since
1.1
OSGI_JDBC_CAPABILITY_DATASOURCEback to summary
public static final String OSGI_JDBC_CAPABILITY_DATASOURCE

OSGI_JDBC_CAPABILITY service property which indicates that the DataSourceFactory is able to provide a DataSource invoking the createDataSource(Properties props) method.

Since
1.1
OSGI_JDBC_CAPABILITY_DRIVERback to summary
public static final String OSGI_JDBC_CAPABILITY_DRIVER

OSGI_JDBC_CAPABILITY service property which indicates that the DataSourceFactory is able to provide a Driver invoking the createDriver(Properties props) method.

Since
1.1
OSGI_JDBC_CAPABILITY_XADATASOURCEback to summary
public static final String OSGI_JDBC_CAPABILITY_XADATASOURCE

OSGI_JDBC_CAPABILITY service property which indicates that the DataSourceFactory is able to provide a XADataSource invoking the createXADataSource(Properties props) method.

Since
1.1
OSGI_JDBC_DRIVER_CLASSback to summary
public static final String OSGI_JDBC_DRIVER_CLASS

Service property used by a JDBC driver to declare the driver class when registering a JDBC DataSourceFactory service. Clients may filter or test this property to determine if the driver is suitable, or the desired one.

OSGI_JDBC_DRIVER_NAMEback to summary
public static final String OSGI_JDBC_DRIVER_NAME

Service property used by a JDBC driver to declare the driver name when registering a JDBC DataSourceFactory service. Clients may filter or test this property to determine if the driver is suitable, or the desired one.

OSGI_JDBC_DRIVER_VERSIONback to summary
public static final String OSGI_JDBC_DRIVER_VERSION

Service property used by a JDBC driver to declare the driver version when registering a JDBC DataSourceFactory service. Clients may filter or test this property to determine if the driver is suitable, or the desired one.

Method Detail

createConnectionPoolDataSourceback to summary
public ConnectionPoolDataSource createConnectionPoolDataSource(Properties props) throws SQLException

Create a new ConnectionPoolDataSource using the given properties.

Parameters
props:Properties

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:ConnectionPoolDataSource

A configured ConnectionPoolDataSource.

Exceptions
SQLException:
If the ConnectionPoolDataSource cannot be created.
createDataSourceback to summary
public DataSource createDataSource(Properties props) throws SQLException

Create a new DataSource using the given properties.

Parameters
props:Properties

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:DataSource

A configured DataSource.

Exceptions
SQLException:
If the DataSource cannot be created.
createDriverback to summary
public Driver createDriver(Properties props) throws SQLException

Create a new Driver using the given properties.

Parameters
props:Properties

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:Driver

A configured Driver.

Exceptions
SQLException:
If the Driver cannot be created.
createXADataSourceback to summary
public XADataSource createXADataSource(Properties props) throws SQLException

Create a new XADataSource using the given properties.

Parameters
props:Properties

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:XADataSource

A configured XADataSource.

Exceptions
SQLException:
If the XADataSource cannot be created.