HHH-16302 Clarify that the JDBC timezone is supposed to match the database timezone

See https://hibernate.zulipchat.com/#narrow/stream/132094-hibernate-orm-dev/topic/hibernate.2Etimezone.2Edefault_storage/near/341706032
This commit is contained in:
Yoann Rodière 2023-03-14 13:47:47 +01:00
parent fa53e6da98
commit d09640fe36
2 changed files with 6 additions and 1 deletions

View File

@ -385,6 +385,8 @@ Enable nationalized character support on all string / clob based attribute ( str
Should we not use contextual LOB creation (aka based on `java.sql.Connection#createBlob()` et al)? The default value for HANA, H2, and PostgreSQL is `true`. Should we not use contextual LOB creation (aka based on `java.sql.Connection#createBlob()` et al)? The default value for HANA, H2, and PostgreSQL is `true`.
[[jdbc-time-zone]]`*hibernate.jdbc.time_zone*` (e.g. A `java.util.TimeZone`, a `java.time.ZoneId` or a `String` representation of a `ZoneId`):: [[jdbc-time-zone]]`*hibernate.jdbc.time_zone*` (e.g. A `java.util.TimeZone`, a `java.time.ZoneId` or a `String` representation of a `ZoneId`)::
The timezone to use in the JDBC driver, which is supposed to match the database timezone.
+
Unless specified, the JDBC Driver uses the default JVM time zone. If a different time zone is configured via this setting, the JDBC https://docs.oracle.com/javase/8/docs/api/java/sql/PreparedStatement.html#setTimestamp-int-java.sql.Timestamp-java.util.Calendar-[PreparedStatement#setTimestamp] is going to use a `Calendar` instance according to the specified time zone. Unless specified, the JDBC Driver uses the default JVM time zone. If a different time zone is configured via this setting, the JDBC https://docs.oracle.com/javase/8/docs/api/java/sql/PreparedStatement.html#setTimestamp-int-java.sql.Timestamp-java.util.Calendar-[PreparedStatement#setTimestamp] is going to use a `Calendar` instance according to the specified time zone.
`*hibernate.dialect.oracle.prefer_long_raw*` (e.g. `true` or `false` (default value)):: `*hibernate.dialect.oracle.prefer_long_raw*` (e.g. `true` or `false` (default value))::

View File

@ -1080,7 +1080,10 @@ public interface AvailableSettings {
String BATCH_VERSIONED_DATA = "hibernate.jdbc.batch_versioned_data"; String BATCH_VERSIONED_DATA = "hibernate.jdbc.batch_versioned_data";
/** /**
* Specifies a {@linkplain java.util.TimeZone time zone} that should be passed to * Specifies the {@linkplain java.util.TimeZone time zone} to use in the JDBC driver,
* which is supposed to match the database timezone.
* <p>
* This is the timezone what will be passed to
* {@link java.sql.PreparedStatement#setTimestamp(int, java.sql.Timestamp, java.util.Calendar)} * {@link java.sql.PreparedStatement#setTimestamp(int, java.sql.Timestamp, java.util.Calendar)}
* {@link java.sql.PreparedStatement#setTime(int, java.sql.Time, java.util.Calendar)}, * {@link java.sql.PreparedStatement#setTime(int, java.sql.Time, java.util.Calendar)},
* {@link java.sql.ResultSet#getTimestamp(int, Calendar)}, and * {@link java.sql.ResultSet#getTimestamp(int, Calendar)}, and