Top Description Constructors Methods
org.hibernate.engine.jdbc.connections.internal

public Class UserSuppliedConnectionProviderImpl

extends Object
implements ConnectionProvider
Class Inheritance
All Implemented Interfaces
org.hibernate.engine.jdbc.connections.spi.ConnectionProvider, org.hibernate.service.spi.Wrapped, org.hibernate.service.Service, java.io.Serializable
Imports
java.sql.Connection, .SQLException, org.hibernate.engine.jdbc.connections.spi.ConnectionProvider, org.hibernate.service.UnknownUnwrapTypeException

An implementation of the ConnectionProvider interface that simply throws an exception when a connection is requested, the assumption being that the application is responsible for handing the connection to use to the session
Authors
Gavin King, Steve Ebersole

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
closeConnection(Connection
The JDBC connection to release
conn
)

Implements org.hibernate.engine.jdbc.connections.spi.ConnectionProvider.closeConnection.

Release a connection from Hibernate use.
public Connection
getConnection()

Implements org.hibernate.engine.jdbc.connections.spi.ConnectionProvider.getConnection.

Obtains a connection for Hibernate use according to the underlying strategy of this provider.
public boolean
isUnwrappableAs(Class<T>
The type to check.
unwrapType
)

Implements org.hibernate.service.spi.Wrapped.isUnwrappableAs.

Can this wrapped service be unwrapped as the indicated type?
public boolean
supportsAggressiveRelease()

Implements org.hibernate.engine.jdbc.connections.spi.ConnectionProvider.supportsAggressiveRelease.

Does this connection provider support aggressive release of JDBC connections and re-acquisition of those connections (if need be) later?
public <T> T
unwrap(Class<T>
The java type as which to unwrap this instance.
unwrapType
)

Implements org.hibernate.service.spi.Wrapped.unwrap.

Unproxy the service proxy
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

UserSuppliedConnectionProviderImplback to summary
public UserSuppliedConnectionProviderImpl()

Method Detail

closeConnectionback to summary
public void closeConnection(Connection conn) throws SQLException

Implements org.hibernate.engine.jdbc.connections.spi.ConnectionProvider.closeConnection.

Doc from org.hibernate.engine.jdbc.connections.spi.ConnectionProvider.closeConnection.

Release a connection from Hibernate use.

Parameters
conn:Connection

The JDBC connection to release

Annotations
@Override
Exceptions
SQLException:
Indicates a problem closing the connection
getConnectionback to summary
public Connection getConnection() throws SQLException

Implements org.hibernate.engine.jdbc.connections.spi.ConnectionProvider.getConnection.

Doc from org.hibernate.engine.jdbc.connections.spi.ConnectionProvider.getConnection.

Obtains a connection for Hibernate use according to the underlying strategy of this provider.

Returns:Connection

The obtained JDBC connection

Annotations
@Override
Exceptions
SQLException:
Indicates a problem opening a connection
isUnwrappableAsback to summary
public boolean isUnwrappableAs(Class<T> unwrapType)

Implements org.hibernate.service.spi.Wrapped.isUnwrappableAs.

Doc from org.hibernate.service.spi.Wrapped.isUnwrappableAs.

Can this wrapped service be unwrapped as the indicated type?

Parameters
unwrapType:Class<T>

The type to check.

Returns:boolean

True/false.

Annotations
@Override
supportsAggressiveReleaseback to summary
public boolean supportsAggressiveRelease()

Implements org.hibernate.engine.jdbc.connections.spi.ConnectionProvider.supportsAggressiveRelease.

Doc from org.hibernate.engine.jdbc.connections.spi.ConnectionProvider.supportsAggressiveRelease.

Does this connection provider support aggressive release of JDBC connections and re-acquisition of those connections (if need be) later?

This is used in conjunction with org.hibernate.cfg.Environment#RELEASE_CONNECTIONS to aggressively release JDBC connections. However, the configured ConnectionProvider must support re-acquisition of the same underlying connection for that semantic to work.

Typically, this is only true in managed environments where a container tracks connections by transaction or thread. Note that JTA semantic depends on the fact that the underlying connection provider does support aggressive release.

Returns:boolean

true if aggressive releasing is supported; false otherwise.

Annotations
@Override
unwrapback to summary
public <T> T unwrap(Class<T> unwrapType)

Implements org.hibernate.service.spi.Wrapped.unwrap.

Doc from org.hibernate.service.spi.Wrapped.unwrap.

Unproxy the service proxy

Parameters
unwrapType:Class<T>

The java type as which to unwrap this instance.

Returns:T

The unwrapped reference

Annotations
@Override
@SuppressWarnings:unchecked