Interface JdbcSettings
- All Superinterfaces:
AgroalSettings
,C3p0Settings
,HikariCPSettings
- All Known Subinterfaces:
AvailableSettings
- All Known Implementing Classes:
Environment
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Whether access to JDBC metadata is allowed during bootstrap.static final String
Controls the autocommit mode of JDBC connections obtained from anyConnectionProvider
implementation which respects this setting, which includes the built-in implementations do, except forDatasourceConnectionProviderImpl
.static final String
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 final String
A prefix for properties specifying arbitrary JDBC connection properties.static final String
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 final String
Indicates that Connections obtained from the configuredConnectionProvider
have auto-commit already disabled when they are acquired.static final String
Deprecated.The JPA-standard "jakarta.persistence.jtaDataSource" or "jakarta.persistence.nonJtaDataSource" setting are now preferred.static final String
Specifies the Hibernate SQL dialect, either an instance ofDialect
, aClass
representing a class that extendsDialect
, or the name of a class that extendsDialect
.static final String
Deprecated.UseJAKARTA_HBM2DDL_DB_MAJOR_VERSION
insteadstatic final String
Deprecated.UseJAKARTA_HBM2DDL_DB_MINOR_VERSION
insteadstatic final String
Deprecated.UseJAKARTA_HBM2DDL_DB_NAME
insteadstatic final String
Deprecated.UseJAKARTA_HBM2DDL_DB_VERSION
insteadstatic final String
Controls whether to use JDBC markers (`?`) or dialect native markers for parameters within preparable SQL statements.static final String
Specifies additionalDialectResolver
implementations to register with the standardDialectFactory
.static final String
Deprecated.The JPA-standard settingJAKARTA_JDBC_DRIVER
is now preferred.static final String
Enables formatting of SQL logged to the console.static final String
Deprecated.UseJAKARTA_HBM2DDL_CONNECTION
insteadstatic final String
Enables highlighting of SQL logged to the console using ANSI escape codes.static final String
Specified the JDBC transaction isolation level.static final String
Allows passing a specificConnection
instance to be used bySchemaManagementTool
for the purpose of determining theDialect
, and for performingdatabase actions
if requested.static final String
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 final String
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 final String
Specifies the name of the database vendor (as would be reported byDatabaseMetaData.getDatabaseProductName()
) for the purpose of determining theDialect
to use.static final String
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 final String
Specifies the name of a JDBC driver to use to connect to the database.static final String
Specifies the password to use when connecting via JDBC.static final String
Specifies the JDBC connection URL to use to connect to the database.static final String
Specifies the database user to use when connecting via JDBC.static final String
Specifies a JTADataSource
to use for Connections.static final String
Specifies a non-JTADataSource
to use for Connections.static final String
Specifies the time zone to use in the JDBC driver, which is supposed to match the database timezone.static final String
Deprecated.UseJAKARTA_JDBC_DRIVER
insteadstatic final String
Deprecated.UseJAKARTA_JDBC_PASSWORD
insteadstatic final String
Deprecated.UseJAKARTA_JDBC_URL
insteadstatic final String
Deprecated.UseJAKARTA_JDBC_USER
insteadstatic final String
Deprecated.UseJAKARTA_JTA_DATASOURCE
insteadstatic final String
Deprecated.UseJAKARTA_NON_JTA_DATASOURCE
insteadstatic final String
When enabled, specifies that JDBC statement warnings should be logged.static final String
Specifies a duration in milliseconds defining the minimum query execution time that characterizes a "slow" query.static final String
When enabled, specifies that Hibernate should not use contextual LOB creation.static final String
Deprecated.The JPA-standard settingJAKARTA_JDBC_PASSWORD
is now preferred.static final String
Specifies the maximum number of inactive connections for the built-in connection pool.static final String
Enables logging of generated SQL to the console.static final String
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 final String
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 final String
Deprecated.The JPA-standard settingJAKARTA_JDBC_URL
is now preferred.static final String
Specifies that generated primary keys may be retrieved using the JDBC 3Statement.getGeneratedKeys()
operation.static final String
Controls how Hibernate should handle scrollable results -true
indicates that insensitive scrolling can be usedfalse
indicates that sensitive scrolling must be usedstatic final String
Specifies that comments should be added to the generated SQL.static final String
Deprecated.The JPA-standard settingJAKARTA_JDBC_USER
is now preferred.Fields inherited from interface org.hibernate.cfg.AgroalSettings
AGROAL_ACQUISITION_TIMEOUT, AGROAL_CONFIG_PREFIX, AGROAL_FLUSH_ON_CLOSE, AGROAL_IDLE_TIMEOUT, AGROAL_IDLE_VALIDATION_TIMEOUT, AGROAL_INITIAL_SIZE, AGROAL_INITIAL_SQL, AGROAL_LEAK_TIMEOUT, AGROAL_MAX_LIFETIME, AGROAL_MAX_SIZE, AGROAL_MIN_SIZE, AGROAL_VALIDATE_ON_BORROW, AGROAL_VALIDATION_TIMEOUT
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.HikariCPSettings
HIKARI_ACQUISITION_TIMEOUT, HIKARI_CONFIG_PREFIX, HIKARI_IDLE_TIMEOUT, HIKARI_INITIAL_SQL, HIKARI_INITIALIZATION_TIMEOUT, HIKARI_ISOLATE_INTERNAL_QUERIES, HIKARI_KEEPALIVE_TIME, HIKARI_LEAK_TIMEOUT, HIKARI_MAX_LIFETIME, HIKARI_MAX_SIZE, HIKARI_MIN_IDLE_SIZE, HIKARI_POOL_NAME, HIKARI_READ_ONLY, HIKARI_VALIDATION_TIMEOUT
-
Field Details
-
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:
-
an instance of
-
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:
-
an instance of
-
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:
-
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:
-
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:
-
create a JDBC connection using
-
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:
-
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
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:
- Implementation Specification:
database actions
are not available when supplying just the name and versions
-
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_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_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:
-
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:
- 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
Specifies additionalDialectResolver
implementations to register with the standardDialectFactory
.- See Also:
-
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:
- an instance of
-
POOL_SIZE
Specifies the maximum number of inactive connections for the built-in connection pool.- See Also:
- Default Value:
- 20
-
ISOLATION
Specified the JDBC transaction isolation level.- See Also:
-
AUTOCOMMIT
Controls the autocommit mode of JDBC connections obtained from anyConnectionProvider
implementation which respects this setting, which includes the built-in implementations do, except forDatasourceConnectionProviderImpl
.- See Also:
- Default Value:
false
-
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:
- 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
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:
-
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:
- an instance of
-
SHOW_SQL
Enables logging of generated SQL to the console.- See Also:
- Default Value:
false
-
FORMAT_SQL
Enables formatting of SQL logged to the console.- See Also:
- Default Value:
false
-
HIGHLIGHT_SQL
Enables highlighting of SQL logged to the console using ANSI escape codes.- See Also:
- Default Value:
false
-
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. -
USE_SQL_COMMENTS
Specifies that comments should be added to the generated SQL.- See Also:
- Default Value:
false
-
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. -
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:
- Default Value:
true
if the underlying driver supports scrollable results
-
-
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:
- 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
When enabled, specifies that Hibernate should not use contextual LOB creation. -
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:
-
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:
- an instance of
-
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
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
-
ALLOW_METADATA_ON_BOOT
Whether access to JDBC metadata is allowed during bootstrap. Typically, Hibernate accesses this metadata to understand the capabilities of the underlying database to help minimize needed configuration. Disabling this access means that only explicit settings are used. At a minimum, the Dialect to use must be specified using either the "hibernate.dialect" or "jakarta.persistence.database-product-name" setting. When the Dialect to use is specified in this manner it is generally a good idea to specify the database version as well - Dialects use the version to configure themselves.- Since:
- 6.5
- See Also:
- API Note:
- The specified Dialect may also provide defaults into the "explicit" settings.
- Default Value:
true
-
DRIVER
Deprecated.The JPA-standard settingJAKARTA_JDBC_DRIVER
is now preferred.- See Also:
-
URL
Deprecated.The JPA-standard settingJAKARTA_JDBC_URL
is now preferred.- See Also:
-
USER
Deprecated.The JPA-standard settingJAKARTA_JDBC_USER
is now preferred.- See Also:
-
PASS
Deprecated.The JPA-standard settingJAKARTA_JDBC_PASSWORD
is now preferred.- See Also:
-
DATASOURCE
Deprecated.The JPA-standard "jakarta.persistence.jtaDataSource" or "jakarta.persistence.nonJtaDataSource" setting are now preferred.- See Also:
-
JPA_JTA_DATASOURCE
Deprecated.UseJAKARTA_JTA_DATASOURCE
instead- See Also:
-
JPA_NON_JTA_DATASOURCE
Deprecated.UseJAKARTA_NON_JTA_DATASOURCE
instead- See Also:
-
JPA_JDBC_DRIVER
Deprecated.UseJAKARTA_JDBC_DRIVER
instead- See Also:
-
JPA_JDBC_URL
Deprecated.UseJAKARTA_JDBC_URL
instead- See Also:
-
JPA_JDBC_USER
Deprecated.UseJAKARTA_JDBC_USER
instead- See Also:
-
JPA_JDBC_PASSWORD
Deprecated.UseJAKARTA_JDBC_PASSWORD
instead- See Also:
-
HBM2DDL_CONNECTION
Deprecated.UseJAKARTA_HBM2DDL_CONNECTION
instead- See Also:
-
DIALECT_DB_NAME
Deprecated.UseJAKARTA_HBM2DDL_DB_NAME
instead -
DIALECT_DB_VERSION
Deprecated.UseJAKARTA_HBM2DDL_DB_VERSION
instead- See Also:
-
DIALECT_DB_MAJOR_VERSION
Deprecated.UseJAKARTA_HBM2DDL_DB_MAJOR_VERSION
instead -
DIALECT_DB_MINOR_VERSION
Deprecated.UseJAKARTA_HBM2DDL_DB_MINOR_VERSION
instead
-