Top Description Inners Constructors Methods
org.postgresql.osgi

public Class PGDataSourceFactory

extends Object
implements DataSourceFactory
Class Inheritance
All Implemented Interfaces
org.osgi.service.jdbc.DataSourceFactory
Static Imports
org.postgresql.util.internal.Nullness.castNonNull

This factory service is designed to be used in OSGi Enterprise environments to create and configure JDBC data-sources.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
PGDataSourceFactory.SingleUseProperties

A class that removes properties as they are used (without modifying the supplied initial Properties).

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
public 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
)

Implements org.osgi.service.jdbc.DataSourceFactory.createConnectionPoolDataSource.

Create a new ConnectionPoolDataSource using the given properties.

public 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
)

Implements org.osgi.service.jdbc.DataSourceFactory.createDataSource.

Will create and return either a SimpleDataSource or a PoolingDataSource depending on the presence in the supplied properties of any pool-related property (eg.: JDBC_INITIAL_POOL_SIZE or JDBC_MAX_POOL_SIZE).

public 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
)

Implements org.osgi.service.jdbc.DataSourceFactory.createDriver.

Create a new Driver using the given properties.

private DataSource
private DataSource
public 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
)

Implements org.osgi.service.jdbc.DataSourceFactory.createXADataSource.

Create a new XADataSource using the given properties.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

PGDataSourceFactoryback to summary
public PGDataSourceFactory()

Method Detail

configureBaseDataSourceback to summary
private void configureBaseDataSource(BaseDataSource ds, Properties props) throws SQLException
Annotations
@SuppressWarnings:deprecation
createConnectionPoolDataSourceback to summary
public ConnectionPoolDataSource createConnectionPoolDataSource(Properties props) throws SQLException

Implements org.osgi.service.jdbc.DataSourceFactory.createConnectionPoolDataSource.

Doc from org.osgi.service.jdbc.DataSourceFactory.createConnectionPoolDataSource.

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.

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

Implements org.osgi.service.jdbc.DataSourceFactory.createDataSource.

Will create and return either a SimpleDataSource or a PoolingDataSource depending on the presence in the supplied properties of any pool-related property (eg.: JDBC_INITIAL_POOL_SIZE or JDBC_MAX_POOL_SIZE).

Parameters
props:Properties

Doc from org.osgi.service.jdbc.DataSourceFactory.createDataSource.

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

Doc from org.osgi.service.jdbc.DataSourceFactory.createDataSource.

A configured DataSource.

Annotations
@Override
Exceptions
SQLException:

Doc from org.osgi.service.jdbc.DataSourceFactory.createDataSource.

If the DataSource cannot be created.

createDriverback to summary
public Driver createDriver(Properties props) throws SQLException

Implements org.osgi.service.jdbc.DataSourceFactory.createDriver.

Doc from org.osgi.service.jdbc.DataSourceFactory.createDriver.

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.

Annotations
@Override
Exceptions
SQLException:
If the Driver cannot be created.
createPoolingDataSourceback to summary
private DataSource createPoolingDataSource(Properties props) throws SQLException
Annotations
@SuppressWarnings:deprecation
createSimpleDataSourceback to summary
private DataSource createSimpleDataSource(Properties props) throws SQLException
Annotations
@SuppressWarnings:deprecation
createXADataSourceback to summary
public XADataSource createXADataSource(Properties props) throws SQLException

Implements org.osgi.service.jdbc.DataSourceFactory.createXADataSource.

Doc from org.osgi.service.jdbc.DataSourceFactory.createXADataSource.

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.

Annotations
@Override
Exceptions
SQLException:
If the XADataSource cannot be created.
org.postgresql.osgi back to summary

private Class PGDataSourceFactory.SingleUseProperties

extends Properties
Class Inheritance

A class that removes properties as they are used (without modifying the supplied initial Properties).

Field Summary

Modifier and TypeField and Description
private static final long
Inherited from java.util.Properties:
defaults

Constructor Summary

AccessConstructor and Description
pack-priv
SingleUseProperties(Properties initialProperties)

Method Summary

Modifier and TypeMethod and Description
public @Nullable String
getProperty(String
the property key.
key
)

Overrides java.util.Properties.getProperty.

Searches for the property with the specified key in this property list.

Inherited from java.util.Properties:
clearclonecomputecomputeIfAbsentcomputeIfPresentcontainscontainsKeycontainsValueelementsentrySetequalsforEachgetgetOrDefaultgetPropertyhashCodeisEmptykeyskeySetlistlistloadloadloadFromXMLmergepropertyNamesputputAllputIfAbsentrehashremoveremovereplacereplacereplaceAllsavesetPropertysizestorestorestoreToXMLstoreToXMLstoreToXMLstringPropertyNamestoStringvalues

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.util.Properties.serialVersionUID.

Constructor Detail

SingleUsePropertiesback to summary
pack-priv SingleUseProperties(Properties initialProperties)
Annotations
@SuppressWarnings:method.invocation

Method Detail

getPropertyback to summary
public @Nullable String getProperty(String key)

Overrides java.util.Properties.getProperty.

Doc from java.util.Properties.getProperty.

Searches for the property with the specified key in this property list. If the key is not found in this property list, the default property list, and its defaults, recursively, are then checked. The method returns null if the property is not found.

Parameters
key:String

the property key.

Returns:@Nullable String

the value in this property list with the specified key value.

Annotations
@Override