Interface JdbcSettings
-
- All Superinterfaces:
C3p0Settings
,ProxoolSettings
public interface JdbcSettings extends C3p0Settings, ProxoolSettings
Settings related to JDBC, Connections, pools, Dialects, etc
-
-
Field Summary
Fields Modifier and Type Field Description static String
AUTOCOMMIT
Controls the autocommit mode of JDBC connections obtained from anyConnectionProvider
implementation which respects this setting, which the built-in implementations do, except forDatasourceConnectionProviderImpl
.static String
CONNECTION_HANDLING
Specifies how Hibernate should manage JDBC connections in terms of acquisition and release, either: an instance of the enumerationPhysicalConnectionHandlingMode
, or the name of one of its instances.static String
CONNECTION_PREFIX
A prefix for properties specifying arbitrary JDBC connection properties.static String
CONNECTION_PROVIDER
Specifies aConnectionProvider
to use for obtaining JDBC connections, either: an instance ofConnectionProvider
, aClass
representing a class that implementsConnectionProvider
, or the name of a class that implementsConnectionProvider
.static String
CONNECTION_PROVIDER_DISABLES_AUTOCOMMIT
Indicates that Connections obtained from the configuredConnectionProvider
have auto-commit already disabled when they are acquired.static String
DATASOURCE
Deprecated.The JPA-standardJAKARTA_JTA_DATASOURCE
orJAKARTA_JTA_DATASOURCE
setting is now preferred.static String
DIALECT
Specifies the Hibernate SQL dialect, either an instance ofDialect
, aClass
representing a class that extendsDialect
, or the name of a class that extendsDialect
.static String
DIALECT_DB_MAJOR_VERSION
Deprecated.UseJAKARTA_HBM2DDL_DB_MAJOR_VERSION
insteadstatic String
DIALECT_DB_MINOR_VERSION
Deprecated.UseJAKARTA_HBM2DDL_DB_MINOR_VERSION
insteadstatic String
DIALECT_DB_NAME
Deprecated.UseJAKARTA_HBM2DDL_DB_NAME
insteadstatic String
DIALECT_DB_VERSION
Deprecated.UseJAKARTA_HBM2DDL_DB_VERSION
insteadstatic String
DIALECT_NATIVE_PARAM_MARKERS
Controls whether to use JDBC markers (`?`) or dialect native markers for parameters within preparable SQL statements.static String
DIALECT_RESOLVERS
Specifies additionalDialectResolver
implementations to register with the standardDialectFactory
.static String
DRIVER
Deprecated.The JPA-standard settingJAKARTA_JDBC_DRIVER
is now preferred.static String
FORMAT_SQL
Enables formatting of SQL logged to the console.static String
HBM2DDL_CONNECTION
Deprecated.UseJAKARTA_HBM2DDL_CONNECTION
insteadstatic String
HIGHLIGHT_SQL
Enables highlighting of SQL logged to the console using ANSI escape codes.static String
ISOLATION
Specified the JDBC transaction isolation level.static String
JAKARTA_HBM2DDL_CONNECTION
Allows passing a specificConnection
instance to be used bySchemaManagementTool
for the purpose of determining theDialect
, and for performingdatabase actions
if requested.static String
JAKARTA_HBM2DDL_DB_MAJOR_VERSION
Used in conjunction with "jakarta.persistence.database-product-name" for the purpose of determining theDialect
to use when the name does not provide enough detail.static String
JAKARTA_HBM2DDL_DB_MINOR_VERSION
Used in conjunction with "jakarta.persistence.database-product-name" for the purpose of determining theDialect
to use when the name does not provide enough detail.static String
JAKARTA_HBM2DDL_DB_NAME
Specifies the name of the database vendor (as would be reported byDatabaseMetaData.getDatabaseProductName()
) for the purpose of determining theDialect
to use.static String
JAKARTA_HBM2DDL_DB_VERSION
Used in conjunction with "jakarta.persistence.database-product-name" for the purpose of determining theDialect
to use when the name does not provide enough detail.static String
JAKARTA_JDBC_DRIVER
Specifies the name of a JDBC driver to use to connect to the database.static String
JAKARTA_JDBC_PASSWORD
Specifies the password to use when connecting via JDBC.static String
JAKARTA_JDBC_URL
Specifies the JDBC connection URL to use to connect to the database.static String
JAKARTA_JDBC_USER
Specifies the database user to use when connecting via JDBC.static String
JAKARTA_JTA_DATASOURCE
Specifies a JTADataSource
to use for Connections.static String
JAKARTA_NON_JTA_DATASOURCE
Specifies a non-JTADataSource
to use for Connections.static String
JDBC_TIME_ZONE
Specifies the time zone to use in the JDBC driver, which is supposed to match the database timezone.static String
JPA_JDBC_DRIVER
Deprecated.UseJAKARTA_JDBC_DRIVER
insteadstatic String
JPA_JDBC_PASSWORD
Deprecated.UseJAKARTA_JDBC_PASSWORD
insteadstatic String
JPA_JDBC_URL
Deprecated.UseJAKARTA_JDBC_URL
insteadstatic String
JPA_JDBC_USER
Deprecated.UseJAKARTA_JDBC_USER
insteadstatic String
JPA_JTA_DATASOURCE
Deprecated.UseJAKARTA_JTA_DATASOURCE
insteadstatic String
JPA_NON_JTA_DATASOURCE
Deprecated.UseJAKARTA_NON_JTA_DATASOURCE
insteadstatic String
LOG_JDBC_WARNINGS
When enabled, specifies that JDBC statement warnings should be logged.static String
LOG_SLOW_QUERY
Specifies a duration in milliseconds defining the minimum query execution time that characterizes a "slow" query.static String
NON_CONTEXTUAL_LOB_CREATION
When enabled, specifies that Hibernate should not use contextual LOB creation.static String
PASS
Deprecated.The JPA-standard settingJAKARTA_JDBC_USER
is now preferred.static String
POOL_SIZE
Specifies the maximum number of inactive connections for the built-in connection pool.static String
SHOW_SQL
Enables logging of generated SQL to the console.static String
STATEMENT_FETCH_SIZE
Gives the JDBC driver a hint as to the number of rows that should be fetched from the database when more rows are needed.static String
STATEMENT_INSPECTOR
Specifies aStatementInspector
implementation associated with theSessionFactory
, either: an instance ofStatementInspector
, aClass
representing an class that implementsStatementInspector
, or the name of a class that implementsStatementInspector
.static String
URL
Deprecated.The JPA-standard settingJAKARTA_JDBC_URL
is now preferred.static String
USE_GET_GENERATED_KEYS
Specifies that generated primary keys may be retrieved using the JDBC 3Statement.getGeneratedKeys()
operation.static String
USE_SCROLLABLE_RESULTSET
Controls how Hibernate should handle scrollable results -true
indicates that insensitive scrolling can be usedfalse
indicates that sensitive scrolling must be usedstatic String
USE_SQL_COMMENTS
Specifies that comments should be added to the generated SQL.static String
USER
Deprecated.The JPA-standard settingJAKARTA_JDBC_USER
is now preferred.-
Fields inherited from interface org.hibernate.cfg.C3p0Settings
C3P0_ACQUIRE_INCREMENT, C3P0_CONFIG_PREFIX, C3P0_IDLE_TEST_PERIOD, C3P0_MAX_SIZE, C3P0_MAX_STATEMENTS, C3P0_MIN_SIZE, C3P0_TIMEOUT
-
Fields inherited from interface org.hibernate.cfg.ProxoolSettings
PROXOOL_CONFIG_PREFIX, PROXOOL_EXISTING_POOL, PROXOOL_POOL_ALIAS, PROXOOL_PROPERTIES, PROXOOL_XML
-
-
-
-
Field Detail
-
JAKARTA_JTA_DATASOURCE
static final String JAKARTA_JTA_DATASOURCE
Specifies a JTADataSource
to use for Connections. Hibernate allows either-
an instance of
DataSource
-
a JNDI name under which to obtain the
DataSource
; see alsoEnvironmentSettings.JNDI_URL
,EnvironmentSettings.JNDI_CLASS
,EnvironmentSettings.JNDI_PREFIX
See JPA 2 sections 9.4.3 and 8.2.1.5
- See Also:
- Constant Field Values
-
an instance of
-
JAKARTA_NON_JTA_DATASOURCE
static final String JAKARTA_NON_JTA_DATASOURCE
Specifies a non-JTADataSource
to use for Connections. Hibernate allows either-
an instance of
DataSource
-
a JNDI name under which to obtain the
DataSource
; see alsoEnvironmentSettings.JNDI_URL
,EnvironmentSettings.JNDI_CLASS
,EnvironmentSettings.JNDI_PREFIX
See JPA 2 sections 9.4.3 and 8.2.1.5
- See Also:
- Constant Field Values
-
an instance of
-
JAKARTA_JDBC_DRIVER
static final String JAKARTA_JDBC_DRIVER
Specifies the name of a JDBC driver to use to connect to the database.Used in conjunction with
JAKARTA_JDBC_URL
,JAKARTA_JDBC_USER
andJAKARTA_JDBC_PASSWORD
to specify how to connect to the database.When connections are obtained from a
DataSource
, use eitherJAKARTA_JTA_DATASOURCE
orJAKARTA_NON_JTA_DATASOURCE
instead.See section 8.2.1.9
- See Also:
- Constant Field Values
-
JAKARTA_JDBC_URL
static final String JAKARTA_JDBC_URL
Specifies the JDBC connection URL to use to connect to the database.Used in conjunction with
JAKARTA_JDBC_DRIVER
,JAKARTA_JDBC_USER
andJAKARTA_JDBC_PASSWORD
to specify how to connect to the database.When connections are obtained from a
DataSource
, use eitherJAKARTA_JTA_DATASOURCE
orJAKARTA_NON_JTA_DATASOURCE
instead.See section 8.2.1.9
- See Also:
- Constant Field Values
-
JAKARTA_JDBC_USER
static final String JAKARTA_JDBC_USER
Specifies the database user to use when connecting via JDBC.Used in conjunction with
JAKARTA_JDBC_DRIVER
,JAKARTA_JDBC_URL
andJAKARTA_JDBC_PASSWORD
to specify how to connect to the database.Depending on the configured
ConnectionProvider
, the specified username might be used to:-
create a JDBC connection using
DriverManager.getConnection(String,java.util.Properties)
orDriver.connect(String,java.util.Properties)
, or -
obtain a JDBC connection from a datasource, using
DataSource.getConnection(String, String)
.
See section 8.2.1.9
- See Also:
- Constant Field Values
-
create a JDBC connection using
-
JAKARTA_JDBC_PASSWORD
static final String JAKARTA_JDBC_PASSWORD
Specifies the password to use when connecting via JDBC.Used in conjunction with
JAKARTA_JDBC_DRIVER
,JAKARTA_JDBC_URL
andJAKARTA_JDBC_USER
to specify how to connect to the database.See JPA 2 section 8.2.1.9
- See Also:
- Constant Field Values
-
JAKARTA_HBM2DDL_CONNECTION
static final String JAKARTA_HBM2DDL_CONNECTION
Allows passing a specificConnection
instance to be used bySchemaManagementTool
for the purpose of determining theDialect
, and for performingdatabase actions
if requested.For
Dialect
resolution, "jakarta.persistence.database-product-name" and, optionally, "jakarta.persistence.database-product-version", "jakarta.persistence.database-major-version", and "jakarta.persistence.database-minor-version" can be used instead
-
JAKARTA_HBM2DDL_DB_NAME
static final String JAKARTA_HBM2DDL_DB_NAME
Specifies the name of the database vendor (as would be reported byDatabaseMetaData.getDatabaseProductName()
) for the purpose of determining theDialect
to use.For cases when the name of the database vendor is not enough alone, a combination of "jakarta.persistence.database-product-version", "jakarta.persistence.database-major-version" "jakarta.persistence.database-minor-version" can be used instead
- See Also:
JAKARTA_HBM2DDL_DB_VERSION
,JAKARTA_HBM2DDL_DB_MAJOR_VERSION
,JAKARTA_HBM2DDL_DB_MINOR_VERSION
, Constant Field Values- Implementation Specification:
database actions
are not available when supplying just the name and versions
-
JAKARTA_HBM2DDL_DB_VERSION
static final String JAKARTA_HBM2DDL_DB_VERSION
Used in conjunction with "jakarta.persistence.database-product-name" for the purpose of determining theDialect
to use when the name does not provide enough detail.The value is expected to match what would be returned from
DatabaseMetaData.getDatabaseProductVersion()
) for the underlying database.- See Also:
JAKARTA_HBM2DDL_DB_NAME
, Constant Field Values
-
JAKARTA_HBM2DDL_DB_MAJOR_VERSION
static final String JAKARTA_HBM2DDL_DB_MAJOR_VERSION
Used in conjunction with "jakarta.persistence.database-product-name" for the purpose of determining theDialect
to use when the name does not provide enough detail.The value is expected to match what would be returned from
DatabaseMetaData.getDatabaseMajorVersion()
) for the underlying database.- See Also:
JAKARTA_HBM2DDL_DB_NAME
, Constant Field Values
-
JAKARTA_HBM2DDL_DB_MINOR_VERSION
static final String JAKARTA_HBM2DDL_DB_MINOR_VERSION
Used in conjunction with "jakarta.persistence.database-product-name" for the purpose of determining theDialect
to use when the name does not provide enough detail.The value is expected to match what would be returned from
DatabaseMetaData.getDatabaseMinorVersion()
) for the underlying database.- See Also:
JAKARTA_HBM2DDL_DB_NAME
, Constant Field Values
-
DIALECT
static final String DIALECT
Specifies the Hibernate SQL dialect, either- an instance of
Dialect
, - a
Class
representing a class that extendsDialect
, or - the name of a class that extends
Dialect
.
By default, Hibernate will attempt to automatically determine the dialect from the JDBC URL and JDBC metadata, so this setting is not usually necessary.
- See Also:
Dialect
, Constant Field Values- API Note:
- As of Hibernate 6, this property should not be explicitly specified,
except when using a custom user-written implementation of
Dialect
. Instead, applications should allow Hibernate to select theDialect
automatically.
- an instance of
-
DIALECT_RESOLVERS
static final String DIALECT_RESOLVERS
Specifies additionalDialectResolver
implementations to register with the standardDialectFactory
.- See Also:
- Constant Field Values
-
CONNECTION_PROVIDER
static final String CONNECTION_PROVIDER
Specifies aConnectionProvider
to use for obtaining JDBC connections, either:- an instance of
ConnectionProvider
, - a
Class
representing a class that implementsConnectionProvider
, or - the name of a class that implements
ConnectionProvider
.
The term
"class"
appears in the setting name due to legacy reasons; however it can accept instances.- See Also:
- Constant Field Values
- an instance of
-
POOL_SIZE
static final String POOL_SIZE
Specifies the maximum number of inactive connections for the built-in connection pool.- See Also:
- Constant Field Values
- Default Value:
- 20
-
ISOLATION
static final String ISOLATION
Specified the JDBC transaction isolation level.- See Also:
- Constant Field Values
-
AUTOCOMMIT
static final String AUTOCOMMIT
Controls the autocommit mode of JDBC connections obtained from anyConnectionProvider
implementation which respects this setting, which the built-in implementations do, except forDatasourceConnectionProviderImpl
.- See Also:
- Constant Field Values
-
CONNECTION_PROVIDER_DISABLES_AUTOCOMMIT
static final String CONNECTION_PROVIDER_DISABLES_AUTOCOMMIT
Indicates that Connections obtained from the configuredConnectionProvider
have auto-commit already disabled when they are acquired.It is inappropriate to set this value to
true
when the Connections returned by the provider do not, in fact, have auto-commit disabled. Doing so may lead to Hibernate executing SQL operations outside the scope of any transaction.- Since:
- 5.2.10
- See Also:
SessionFactoryBuilder.applyConnectionProviderDisablesAutoCommit(boolean)
, Constant Field Values- API Note:
- By default, Hibernate calls
Connection.setAutoCommit(boolean)
on newly-obtained connections. This setting allows to circumvent that call (as well as other operations) in the interest of performance. - Default Value:
false
-
CONNECTION_PREFIX
static final String CONNECTION_PREFIX
A prefix for properties specifying arbitrary JDBC connection properties. These properties are simply passed along to the provider when creating a connection.For example, declaring
hibernate.connection.foo=bar
tells Hibernate to appendfoo=bar
to the JDBC connection URL.- See Also:
- Constant Field Values
-
STATEMENT_INSPECTOR
static final String STATEMENT_INSPECTOR
Specifies aStatementInspector
implementation associated with theSessionFactory
, either:- an instance of
StatementInspector
, - a
Class
representing an class that implementsStatementInspector
, or - the name of a class that implements
StatementInspector
.
- Since:
- 5.0
- See Also:
SessionFactoryBuilder.applyStatementInspector(StatementInspector)
, Constant Field Values
- an instance of
-
SHOW_SQL
static final String SHOW_SQL
Enables logging of generated SQL to the console.- See Also:
- Constant Field Values
- Default Value:
false
-
FORMAT_SQL
static final String FORMAT_SQL
Enables formatting of SQL logged to the console.- See Also:
- Constant Field Values
- Default Value:
false
-
HIGHLIGHT_SQL
static final String HIGHLIGHT_SQL
Enables highlighting of SQL logged to the console using ANSI escape codes.- See Also:
- Constant Field Values
- Default Value:
false
-
LOG_SLOW_QUERY
static final String LOG_SLOW_QUERY
Specifies a duration in milliseconds defining the minimum query execution time that characterizes a "slow" query. Any SQL query which takes longer than this amount of time to execute will be logged.A value of
0
, the default, disables logging of "slow" queries.- See Also:
org.hibernate.stat.Statistics#getSlowQueries()
, Constant Field Values
-
USE_SQL_COMMENTS
static final String USE_SQL_COMMENTS
Specifies that comments should be added to the generated SQL.- See Also:
SessionFactoryBuilder.applySqlComments(boolean)
, Constant Field Values- Default Value:
false
-
STATEMENT_FETCH_SIZE
static final String STATEMENT_FETCH_SIZE
Gives the JDBC driver a hint as to the number of rows that should be fetched from the database when more rows are needed. If0
, the JDBC driver's default settings will be used.- See Also:
Statement.setFetchSize(int)
,SessionFactoryBuilder.applyJdbcFetchSize(int)
,ScrollableResults.setFetchSize(int)
, Constant Field Values- Default Value:
0
-
USE_SCROLLABLE_RESULTSET
static final String USE_SCROLLABLE_RESULTSET
Controls how Hibernate should handle scrollable results --
true
indicates that insensitive scrolling can be used -
false
indicates that sensitive scrolling must be used
- See Also:
SessionFactoryBuilder.applyScrollableResultsSupport(boolean)
,Query.scroll()
,ExtractedDatabaseMetaData.supportsScrollableResults()
, Constant Field Values- Default Value:
true
if the underlying driver supports scrollable results
-
-
DIALECT_NATIVE_PARAM_MARKERS
@Incubating static final String DIALECT_NATIVE_PARAM_MARKERS
Controls whether to use JDBC markers (`?`) or dialect native markers for parameters within preparable SQL statements.- Since:
- 6.2
- See Also:
ParameterMarkerStrategy
,Dialect.getNativeParameterMarkerStrategy()
, Constant Field Values- Implementation Note:
False
by default, indicating standard JDBC parameter markers (`?`) are used. Set totrue
to use the Dialect's native markers, if any. For Dialects without native markers, the standard JDBC strategy is used.
-
NON_CONTEXTUAL_LOB_CREATION
static final String NON_CONTEXTUAL_LOB_CREATION
When enabled, specifies that Hibernate should not use contextual LOB creation.- See Also:
LobCreator
,LobCreationContext
, Constant Field Values
-
LOG_JDBC_WARNINGS
static final String LOG_JDBC_WARNINGS
When enabled, specifies that JDBC statement warnings should be logged.The default is determined by
Dialect.isJdbcLogWarningsEnabledByDefault()
.- Since:
- 5.1
- See Also:
Statement.getWarnings()
, Constant Field Values
-
JDBC_TIME_ZONE
static final String JDBC_TIME_ZONE
Specifies the time zone to use in the JDBC driver, which is supposed to match the database timezone.This is the timezone what will be passed to
PreparedStatement.setTimestamp(int, java.sql.Timestamp, java.util.Calendar)
PreparedStatement.setTime(int, java.sql.Time, java.util.Calendar)
,ResultSet.getTimestamp(int, Calendar)
, andResultSet.getTime(int, Calendar)
when binding parameters.The time zone may be given as:
- an instance of
TimeZone
, - an instance of
ZoneId
, or - a time zone ID string to be passed to
ZoneId.of(String)
.
By default, the JVM default time zone is assumed by the JDBC driver.
- Since:
- 5.2.3
- See Also:
- Constant Field Values
- an instance of
-
USE_GET_GENERATED_KEYS
static final String USE_GET_GENERATED_KEYS
Specifies that generated primary keys may be retrieved using the JDBC 3Statement.getGeneratedKeys()
operation.Usually, performance will be improved if this behavior is enabled, assuming the JDBC driver supports
getGeneratedKeys()
.
-
CONNECTION_HANDLING
static final String CONNECTION_HANDLING
Specifies how Hibernate should manage JDBC connections in terms of acquisition and release, either:- an instance of the enumeration
PhysicalConnectionHandlingMode
, or - the name of one of its instances.
The default is
DELAYED_ACQUISITION_AND_RELEASE_AFTER_TRANSACTION
. - an instance of the enumeration
-
DRIVER
@Deprecated static final String DRIVER
Deprecated.The JPA-standard settingJAKARTA_JDBC_DRIVER
is now preferred.- See Also:
- Constant Field Values
-
URL
@Deprecated static final String URL
Deprecated.The JPA-standard settingJAKARTA_JDBC_URL
is now preferred.- See Also:
- Constant Field Values
-
USER
@Deprecated static final String USER
Deprecated.The JPA-standard settingJAKARTA_JDBC_USER
is now preferred.- See Also:
PASS
, Constant Field Values
-
PASS
@Deprecated static final String PASS
Deprecated.The JPA-standard settingJAKARTA_JDBC_USER
is now preferred.- See Also:
USER
, Constant Field Values
-
DATASOURCE
@Deprecated static final String DATASOURCE
Deprecated.The JPA-standardJAKARTA_JTA_DATASOURCE
orJAKARTA_JTA_DATASOURCE
setting is now preferred.- See Also:
DataSource
, Constant Field Values
-
JPA_JTA_DATASOURCE
@Deprecated static final String JPA_JTA_DATASOURCE
Deprecated.UseJAKARTA_JTA_DATASOURCE
instead- See Also:
- Constant Field Values
-
JPA_NON_JTA_DATASOURCE
@Deprecated static final String JPA_NON_JTA_DATASOURCE
Deprecated.UseJAKARTA_NON_JTA_DATASOURCE
instead- See Also:
- Constant Field Values
-
JPA_JDBC_DRIVER
@Deprecated static final String JPA_JDBC_DRIVER
Deprecated.UseJAKARTA_JDBC_DRIVER
instead- See Also:
- Constant Field Values
-
JPA_JDBC_URL
@Deprecated static final String JPA_JDBC_URL
Deprecated.UseJAKARTA_JDBC_URL
instead- See Also:
- Constant Field Values
-
JPA_JDBC_USER
@Deprecated static final String JPA_JDBC_USER
Deprecated.UseJAKARTA_JDBC_USER
instead- See Also:
- Constant Field Values
-
JPA_JDBC_PASSWORD
@Deprecated static final String JPA_JDBC_PASSWORD
Deprecated.UseJAKARTA_JDBC_PASSWORD
instead- See Also:
- Constant Field Values
-
HBM2DDL_CONNECTION
@Deprecated static final String HBM2DDL_CONNECTION
Deprecated.UseJAKARTA_HBM2DDL_CONNECTION
instead- See Also:
- Constant Field Values
-
DIALECT_DB_NAME
@Deprecated static final String DIALECT_DB_NAME
Deprecated.UseJAKARTA_HBM2DDL_DB_NAME
instead
-
DIALECT_DB_VERSION
@Deprecated static final String DIALECT_DB_VERSION
Deprecated.UseJAKARTA_HBM2DDL_DB_VERSION
instead- See Also:
DIALECT_DB_NAME
, Constant Field Values
-
DIALECT_DB_MAJOR_VERSION
@Deprecated static final String DIALECT_DB_MAJOR_VERSION
Deprecated.UseJAKARTA_HBM2DDL_DB_MAJOR_VERSION
instead
-
DIALECT_DB_MINOR_VERSION
@Deprecated static final String DIALECT_DB_MINOR_VERSION
Deprecated.UseJAKARTA_HBM2DDL_DB_MINOR_VERSION
instead
-
-