Top Description Fields Constructors Methods
org.hibernate.connection

public final Class ConnectionProviderFactory

extends Object
Class Inheritance
Imports
java.beans.BeanInfo, .IntrospectionException, .Introspector, .PropertyDescriptor, java.lang.reflect.InvocationTargetException, .Method, java.util.HashSet, .Iterator, .Map, .Properties, .Set, org.slf4j.Logger, .LoggerFactory, org.hibernate.HibernateException, org.hibernate.cfg.Environment, org.hibernate.util.ReflectHelper

Instantiates a connection provider given either System properties or a java.util.Properties instance. The ConnectionProviderFactory first attempts to find a name of a ConnectionProvider subclass in the property hibernate.connection.provider_class. If missing, heuristics are used to choose either DriverManagerConnectionProvider, DatasourceConnectionProvider, C3P0ConnectionProvider or DBCPConnectionProvider.
Author
Gavin King
See Also
ConnectionProvider

Field Summary

Modifier and TypeField and Description
private static final Logger
private static final Set<E>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static boolean
private static boolean
public static Properties
getConnectionProperties(Properties properties)

Transform JDBC connection properties.

private static ConnectionProvider
public static ConnectionProvider

Returns:

The created connection provider.
newConnectionProvider
()

Instantiate a ConnectionProvider using System properties.

public static ConnectionProvider

Returns:

ConnectionProvider
newConnectionProvider
(Properties
hibernate SessionFactory properties
properties
)

Instantiate a ConnectionProvider using given properties.

public static ConnectionProvider

Returns:

The created connection provider
newConnectionProvider
(Properties
Properties being used to build the org.hibernate.SessionFactory.
properties
,
Map<K, V>
Something to be injected in the connection provided
connectionProviderInjectionData
)

Create a connection provider based on the given information.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

logback to summary
private static final Logger log
SPECIAL_PROPERTIESback to summary
private static final Set<E> SPECIAL_PROPERTIES

Constructor Detail

ConnectionProviderFactoryback to summary
private ConnectionProviderFactory()

Method Detail

c3p0ConfigDefinedback to summary
private static boolean c3p0ConfigDefined(Properties properties)
c3p0ProviderPresentback to summary
private static boolean c3p0ProviderPresent()
getConnectionPropertiesback to summary
public static Properties getConnectionProperties(Properties properties)

Transform JDBC connection properties. Passed in the form hibernate.connection.* to the format accepted by DriverManager by trimming the leading "hibernate.connection".

initializeConnectionProviderFromConfigback to summary
private static ConnectionProvider initializeConnectionProviderFromConfig(String providerClass)
newConnectionProviderback to summary
public static ConnectionProvider newConnectionProvider() throws HibernateException

Instantiate a ConnectionProvider using System properties.

Returns:ConnectionProvider

The created connection provider.

newConnectionProviderback to summary
public static ConnectionProvider newConnectionProvider(Properties properties) throws HibernateException

Instantiate a ConnectionProvider using given properties. Method newConnectionProvider.

Parameters
properties:Properties

hibernate SessionFactory properties

Returns:ConnectionProvider

ConnectionProvider

newConnectionProviderback to summary
public static ConnectionProvider newConnectionProvider(Properties properties, Map<K, V> connectionProviderInjectionData) throws HibernateException

Create a connection provider based on the given information.

Parameters
properties:Properties

Properties being used to build the org.hibernate.SessionFactory.

connectionProviderInjectionData:Map<K, V>

Something to be injected in the connection provided

Returns:ConnectionProvider

The created connection provider