站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Hibernate 2.1.8 正式版 API 英文文档

ConnectionProviderFactory (Hibernate API Documentation) - Hibernate 2.1.8 正式版 API 英文文档


net.sf.hibernate.connection
Class ConnectionProviderFactory

java.lang.Object
  extended bynet.sf.hibernate.connection.ConnectionProviderFactory

public final class ConnectionProviderFactory
extends Object

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

Method Summary
static Properties getConnectionProperties(Properties properties)
          Transform JDBC connection properties.
static ConnectionProvider newConnectionProvider()
          Instantiate a ConnectionProvider using System properties.
static ConnectionProvider newConnectionProvider(Properties properties)
          Instantiate a ConnectionProvider using given properties.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newConnectionProvider

public static ConnectionProvider newConnectionProvider()
                                                throws HibernateException
Instantiate a ConnectionProvider using System properties.

Returns:
ConnectionProvider
Throws:
HibernateException

newConnectionProvider

public static ConnectionProvider newConnectionProvider(Properties properties)
                                                throws HibernateException
Instantiate a ConnectionProvider using given properties. Method newConnectionProvider.

Parameters:
properties - hibernate SessionFactory properties
Returns:
ConnectionProvider
Throws:
HibernateException

getConnectionProperties

public static Properties getConnectionProperties(Properties properties)
Transform JDBC connection properties. Passed in the form hibernate.connection.* to the format accepted by DriverManager by triming the leading "hibernate.connection".