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

public abstract Class BasicConnectionCreator

extends Object
implements ConnectionCreator
Class Inheritance
All Implemented Interfaces
org.hibernate.engine.jdbc.connections.internal.ConnectionCreator
Known Direct Subclasses
org.hibernate.engine.jdbc.connections.internal.DriverConnectionCreator, org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionCreator
Imports
java.sql.Connection, .SQLException, .Statement, java.util.Properties, org.hibernate.HibernateException, .JDBCException, org.hibernate.engine.jdbc.spi.JdbcServices, org.hibernate.exception.JDBCConnectionException, org.hibernate.exception.internal.SQLStateConversionDelegate, org.hibernate.exception.spi.ConversionContext, .SQLExceptionConversionDelegate, .ViolatedConstraintNameExtracter, org.hibernate.internal.util.ValueHolder, org.hibernate.service.spi.ServiceRegistryImplementor

Template (as in template pattern) support for ConnectionCreator implementors.
Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
private final boolean
private final Properties
private final String
private final Integer
private final ServiceRegistryImplementor
private ValueHolder<SQLExceptionConversionDelegate>
private final String

Constructor Summary

AccessConstructor and Description
public
BasicConnectionCreator(ServiceRegistryImplementor serviceRegistry, String url, Properties connectionProps, boolean autocommit, Integer isolation, String initSql)

Method Summary

Modifier and TypeMethod and Description
protected JDBCException
public Connection
public Properties
getConnectionProperties()

Exposed for testing purposes only.

public String
getUrl()

Implements org.hibernate.engine.jdbc.connections.internal.ConnectionCreator.getUrl.

Obtain the URL to which this creator connects.
protected abstract Connection
makeConnection(String url, Properties connectionProps)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

autoCommitback to summary
private final boolean autoCommit
connectionPropsback to summary
private final Properties connectionProps
initSqlback to summary
private final String initSql
isolationback to summary
private final Integer isolation
serviceRegistryback to summary
private final ServiceRegistryImplementor serviceRegistry
simpleConverterAccessback to summary
private ValueHolder<SQLExceptionConversionDelegate> simpleConverterAccess
urlback to summary
private final String url

Constructor Detail

BasicConnectionCreatorback to summary
public BasicConnectionCreator(ServiceRegistryImplementor serviceRegistry, String url, Properties connectionProps, boolean autocommit, Integer isolation, String initSql)

Method Detail

convertSqlExceptionback to summary
protected JDBCException convertSqlException(String message, SQLException e)
createConnectionback to summary
public Connection createConnection()

Implements org.hibernate.engine.jdbc.connections.internal.ConnectionCreator.createConnection.

Doc from org.hibernate.engine.jdbc.connections.internal.ConnectionCreator.createConnection.

Create a Connection

Returns:Connection

The created Connection

Annotations
@Override
getConnectionPropertiesback to summary
public Properties getConnectionProperties()

Exposed for testing purposes only.

getUrlback to summary
public String getUrl()

Implements org.hibernate.engine.jdbc.connections.internal.ConnectionCreator.getUrl.

Doc from org.hibernate.engine.jdbc.connections.internal.ConnectionCreator.getUrl.

Obtain the URL to which this creator connects. Intended just for informational (logging) purposes.

Returns:String

The connection URL.

Annotations
@Override
makeConnectionback to summary
protected abstract Connection makeConnection(String url, Properties connectionProps)