org.hibernate.connection

Class DatasourceConnectionProvider

Implemented Interfaces:
ConnectionProvider

public class DatasourceConnectionProvider
extends java.lang.Object
implements ConnectionProvider

A connection provider that uses a DataSource registered with JNDI. Hibernate will use this ConnectionProvider by default if the property hibernate.connection.datasource is set.
Author:
Gavin King
See Also:
ConnectionProvider

Method Summary

void
close()
Release all resources held by this provider.
void
closeConnection(Connection conn)
Dispose of a used connection.
void
configure(Properties props)
Initialize the connection provider from given properties.
Connection
getConnection()
Grab a connection, with the autocommit mode specified by hibernate.connection.autocommit.
DataSource
getDataSource()
void
setDataSource(DataSource ds)
boolean
supportsAggressiveRelease()

Method Details

close

public void close()
Release all resources held by this provider. JavaDoc requires a second sentence.
Specified by:
close in interface ConnectionProvider

closeConnection

public void closeConnection(Connection conn)
            throws SQLException
Dispose of a used connection.
Specified by:
closeConnection in interface ConnectionProvider
Parameters:
conn - a JDBC connection

configure

public void configure(Properties props)
            throws HibernateException
Initialize the connection provider from given properties.
Specified by:
configure in interface ConnectionProvider
Parameters:
props - SessionFactory properties

getConnection

public Connection getConnection()
            throws SQLException
Grab a connection, with the autocommit mode specified by hibernate.connection.autocommit.
Specified by:
getConnection in interface ConnectionProvider
Returns:
a JDBC connection

getDataSource

public DataSource getDataSource()

setDataSource

public void setDataSource(DataSource ds)

supportsAggressiveRelease

public boolean supportsAggressiveRelease()
Specified by:
supportsAggressiveRelease in interface ConnectionProvider