Skip to content

Commit

Permalink
correct order of properties and add getter/setter for useWithTimezone…
Browse files Browse the repository at this point in the history
… into BaseDataSource
  • Loading branch information
davecramer committed Apr 26, 2024
1 parent 0e88656 commit ec5c7e2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
22 changes: 11 additions & 11 deletions pgjdbc/src/main/java/org/postgresql/PGProperty.java
Original file line number Diff line number Diff line change
Expand Up @@ -600,17 +600,6 @@ public enum PGProperty {
"0",
"The timeout value in seconds max(2147484) used for socket read operations."),

/**
* Enable mapping of `WITH TIMEZONE` to {@see java.sql.Types.TIME_WITH_TIMEZONE}
* and {@see java.sql.Types.TIMESTAMP_WITH_TIMEZONE} .
* The default is {@code false}
*/
USE_WITH_TIMEZONE(
"useWithTimezone",
"false",
"Map time with timezone and timestamp with timezone to (@code TIME_WITH_TIMEZONE) and (@code TIMESTAMP_WITH_TIMEZONE)"
+ "The default is (@code false)"),

/**
* Control use of SSL: empty or {@code true} values imply {@code sslmode==verify-full}
*/
Expand Down Expand Up @@ -777,6 +766,17 @@ public enum PGProperty {
"false",
"Use SPNEGO in SSPI authentication requests"),

/**
* Enable mapping of `WITH TIMEZONE` to {@see java.sql.Types.TIME_WITH_TIMEZONE}
* and {@see java.sql.Types.TIMESTAMP_WITH_TIMEZONE} .
* The default is {@code false}
*/
USE_WITH_TIMEZONE(
"useWithTimezone",
"false",
"Map time with timezone and timestamp with timezone to (@code TIME_WITH_TIMEZONE) and (@code TIMESTAMP_WITH_TIMEZONE)"
+ "The default is (@code false)"),

/**
* Factory class to instantiate factories for XML processing.
* The default factory disables external entity processing.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -592,18 +592,18 @@ public int getSocketTimeout() {
}

/**
* @param enabled if PG types with TIMEZONE should map into SQL types with TIMEZONE
* @param enabled if PostgreSQL types with TIMEZONE should map into SQL types with TIMEZONE
* @see PGProperty#USE_WITH_TIMEZONE
*/
public void setSqlTypesWithTimezone(boolean enabled) {
public void setUseWithTimezone(boolean enabled) {
PGProperty.USE_WITH_TIMEZONE.set(properties, enabled);
}

/**
* @return true if SQL types with TIMEZONE is enabled
* @return true if PostgreSQL types with TIMEZONE map to java time types with TIMEZON
* @see PGProperty#USE_WITH_TIMEZONE
*/
public boolean getSqlTypesWithTimezone() {
public boolean getUseWithTimezone() {
return PGProperty.USE_WITH_TIMEZONE.getBoolean(properties);
}

Expand Down

0 comments on commit ec5c7e2

Please sign in to comment.