public enum PGProperty extends Enum<PGProperty>
Enum Constant and Description |
---|
ADAPTIVE_FETCH
Specifies if number of rows, used during fetching rows of a result set, should be computed
dynamically.
|
ADAPTIVE_FETCH_MAXIMUM
Specifies the highest number of rows which can be calculated by adaptiveFetch.
|
ADAPTIVE_FETCH_MINIMUM
Specifies the lowest number of rows which can be calculated by adaptiveFetch.
|
ALLOW_ENCODING_CHANGES
When using the V3 protocol the driver monitors changes in certain server configuration
parameters that should not be touched by end users.
|
APPLICATION_NAME
The application name (require server version >= 9.0).
|
ASSUME_MIN_SERVER_VERSION
Assume the server is at least that version.
|
AUTOSAVE
Specifies what the driver should do if a query fails.
|
BINARY_TRANSFER
Use binary format for sending and receiving data if possible.
|
BINARY_TRANSFER_DISABLE
Comma separated list of types to disable binary transfer.
|
BINARY_TRANSFER_ENABLE
Comma separated list of types to enable binary transfer.
|
CANCEL_SIGNAL_TIMEOUT
Cancel command is sent out of band over its own connection, so cancel message can itself get
stuck.
|
CLEANUP_SAVEPOINTS
Determine whether SAVEPOINTS used in AUTOSAVE will be released per query or not
|
CONNECT_TIMEOUT
The timeout value used for socket connect operations.
|
CURRENT_SCHEMA
Specify the schema (or several schema separated by commas) to be set in the search-path.
|
DATABASE_METADATA_CACHE_FIELDS
Specifies the maximum number of fields to be cached per connection.
|
DATABASE_METADATA_CACHE_FIELDS_MIB
Specifies the maximum size (in megabytes) of fields to be cached per connection.
|
DEFAULT_ROW_FETCH_SIZE
Default parameter for
Statement.getFetchSize() . |
DISABLE_COLUMN_SANITISER
Enable optimization that disables column name sanitiser.
|
ESCAPE_SYNTAX_CALL_MODE
Specifies how the driver transforms JDBC escape call syntax into underlying SQL, for invoking procedures or functions.
|
GSS_ENC_MODE |
GSS_LIB
Force one of
SSPI (Windows transparent single-sign-on)
GSSAPI (Kerberos, via JSSE)
to be used when the server requests Kerberos or SSPI authentication.
|
HIDE_UNPRIVILEGED_OBJECTS
Enable mode to filter out the names of database objects for which the current user has no privileges
granted from appearing in the DatabaseMetaData returned by the driver.
|
HOST_RECHECK_SECONDS |
JAAS_APPLICATION_NAME
Specifies the name of the JAAS system or application login configuration.
|
JAAS_LOGIN
Flag to enable/disable obtaining a GSS credential via JAAS login before authenticating.
|
KERBEROS_SERVER_NAME
The Kerberos service name to use when authenticating with GSSAPI.
|
LOAD_BALANCE_HOSTS |
LOG_SERVER_ERROR_DETAIL
Whether to include full server error detail in exception messages.
|
LOG_UNCLOSED_CONNECTIONS
When connections that are not explicitly closed are garbage collected, log the stacktrace from
the opening of the connection to trace the leak source.
|
LOGGER_FILE
File name output of the Logger, if set, the Logger will use a
FileHandler to write to a specified file. |
LOGGER_LEVEL
Logger level of the driver.
|
LOGIN_TIMEOUT
Specify how long to wait for establishment of a database connection.
|
MAX_RESULT_BUFFER
Specifies size of buffer during fetching result set.
|
OPTIONS
Specify 'options' connection initialization parameter.
|
PASSWORD
Password to use when authenticating.
|
PG_DBNAME
Database name to connect to (may be specified directly in the JDBC URL).
|
PG_HOST
Hostname of the PostgreSQL server (may be specified directly in the JDBC URL).
|
PG_PORT
Port of the PostgreSQL server (may be specified directly in the JDBC URL).
|
PREFER_QUERY_MODE
Specifies which mode is used to execute queries to database: simple means ('Q' execute, no parse, no bind, text mode only),
extended means always use bind/execute messages, extendedForPrepared means extended for prepared statements only,
extendedCacheEverything means use extended protocol and try cache every statement (including Statement.execute(String sql)) in a query cache.
|
PREPARE_THRESHOLD
Sets the default threshold for enabling server-side prepare.
|
PREPARED_STATEMENT_CACHE_QUERIES
Specifies the maximum number of entries in cache of prepared statements.
|
PREPARED_STATEMENT_CACHE_SIZE_MIB
Specifies the maximum size (in megabytes) of the prepared statement cache.
|
PROTOCOL_VERSION
Force use of a particular protocol version when connecting, if set, disables protocol version
fallback.
|
QUOTE_RETURNING_IDENTIFIERS
Quote returning columns.
|
READ_ONLY
Puts this connection in read-only mode.
|
READ_ONLY_MODE
Connection parameter to control behavior when
Connection.setReadOnly(boolean) is set to true . |
RECEIVE_BUFFER_SIZE
Socket read buffer size (SO_RECVBUF).
|
REPLICATION
Connection parameter passed in the startup message.
|
REWRITE_BATCHED_INSERTS
Configure optimization to enable batch insert re-writing.
|
SEND_BUFFER_SIZE
Socket write buffer size (SO_SNDBUF).
|
SOCKET_FACTORY
Socket factory used to create socket.
|
SOCKET_FACTORY_ARG
Deprecated.
use
..Factory(Properties) constructor. |
SOCKET_TIMEOUT
The timeout value used for socket read operations.
|
SSL
Control use of SSL: empty or
true values imply sslmode==verify-full |
SSL_CERT
File containing the SSL Certificate.
|
SSL_FACTORY
Classname of the SSL Factory to use (instance of
javax.net.ssl.SSLSocketFactory ). |
SSL_FACTORY_ARG
Deprecated.
use
..Factory(Properties) constructor. |
SSL_HOSTNAME_VERIFIER
Classname of the SSL HostnameVerifier to use (instance of
javax.net.ssl.HostnameVerifier ). |
SSL_KEY
File containing the SSL Key.
|
SSL_MODE
Parameter governing the use of SSL.
|
SSL_PASSWORD
The SSL password to use in the default CallbackHandler.
|
SSL_PASSWORD_CALLBACK
The classname instantiating
javax.security.auth.callback.CallbackHandler to use. |
SSL_ROOT_CERT
File containing the root certificate when validating server (
sslmode = verify-ca or verify-full ). |
SSPI_SERVICE_CLASS
Specifies the name of the SSPI service class that forms the service class part of the SPN.
|
STRING_TYPE
Bind String to either
unspecified or varchar . |
TARGET_SERVER_TYPE |
TCP_KEEP_ALIVE
Enable or disable TCP keep-alive.
|
UNKNOWN_LENGTH
Specifies the length to return for types of unknown length.
|
USE_SPNEGO
Use SPNEGO in SSPI authentication requests.
|
USER
Username to connect to the database as.
|
XML_FACTORY_FACTORY
Factory class to instantiate factories for XML processing.
|
Modifier and Type | Method and Description |
---|---|
static @Nullable PGProperty |
forName(String name) |
@Nullable String |
get(Properties properties)
Returns the value of the connection parameters according to the given
Properties or the
default value. |
boolean |
getBoolean(Properties properties)
Return the boolean value for this connection parameter in the given
Properties . |
String[] |
getChoices()
Returns the available values for this connection parameter.
|
@Nullable String |
getDefaultValue()
Returns the default value for this connection parameter.
|
String |
getDescription()
Returns the description for this connection parameter.
|
int |
getInt(Properties properties)
Return the int value for this connection parameter in the given
Properties . |
@Nullable Integer |
getInteger(Properties properties)
Return the
Integer value for this connection parameter in the given Properties . |
int |
getIntNoCheck(Properties properties)
Return the int value for this connection parameter in the given
Properties . |
String |
getName()
Returns the name of the connection parameter.
|
@Nullable String |
getSetString(Properties properties)
Return the property if exists but avoiding the default.
|
boolean |
isDeprecated()
Returns whether this connection parameter is deprecated.
|
boolean |
isPresent(Properties properties)
Test whether this property is present in the given
Properties . |
boolean |
isRequired()
Returns whether this parameter is required.
|
void |
set(Properties properties,
boolean value)
Set the boolean value for this connection parameter in the given
Properties . |
void |
set(Properties properties,
int value)
Set the int value for this connection parameter in the given
Properties . |
void |
set(Properties properties,
@Nullable String value)
Set the value for this connection parameter in the given
Properties . |
DriverPropertyInfo |
toDriverPropertyInfo(Properties properties)
Convert this connection parameter and the value read from the given
Properties into a
DriverPropertyInfo . |
static PGProperty |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static PGProperty[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final PGProperty ADAPTIVE_FETCH
public static final PGProperty ADAPTIVE_FETCH_MAXIMUM
public static final PGProperty ADAPTIVE_FETCH_MINIMUM
public static final PGProperty ALLOW_ENCODING_CHANGES
client_encoding
setting is set
by the driver and should not be altered. If the driver detects a change it will abort the
connection.public static final PGProperty APPLICATION_NAME
public static final PGProperty ASSUME_MIN_SERVER_VERSION
public static final PGProperty AUTOSAVE
autosave=always
mode, JDBC driver sets a savepoint before each query,
and rolls back to that savepoint in case of failure. In autosave=never
mode (default), no savepoint dance is made ever.
In autosave=conservative
mode, savepoint is set for each query, however the rollback is done only for rare cases
like 'cached statement cannot change return type' or 'statement XXX is not valid' so JDBC driver rollsback and retriespublic static final PGProperty BINARY_TRANSFER
public static final PGProperty BINARY_TRANSFER_DISABLE
public static final PGProperty BINARY_TRANSFER_ENABLE
public static final PGProperty CANCEL_SIGNAL_TIMEOUT
public static final PGProperty CLEANUP_SAVEPOINTS
public static final PGProperty CONNECT_TIMEOUT
The timeout value used for socket connect operations. If connecting to the server takes longer than this value, the connection is broken.
The timeout is specified in seconds and a value of zero means that it is disabled.
public static final PGProperty CURRENT_SCHEMA
public static final PGProperty DATABASE_METADATA_CACHE_FIELDS
0
disables the cache.public static final PGProperty DATABASE_METADATA_CACHE_FIELDS_MIB
0
disables the cache.public static final PGProperty DEFAULT_ROW_FETCH_SIZE
Statement.getFetchSize()
. A value of 0
means
that need fetch all rows at oncepublic static final PGProperty DISABLE_COLUMN_SANITISER
public static final PGProperty ESCAPE_SYNTAX_CALL_MODE
escapeSyntaxCallMode=select
mode (the default), the driver always uses a SELECT statement (allowing function invocation only).
In escapeSyntaxCallMode=callIfNoReturn
mode, the driver uses a CALL statement (allowing procedure invocation) if there is no return parameter specified, otherwise the driver uses a SELECT statement.
In escapeSyntaxCallMode=call
mode, the driver always uses a CALL statement (allowing procedure invocation only).public static final PGProperty GSS_ENC_MODE
public static final PGProperty GSS_LIB
public static final PGProperty HIDE_UNPRIVILEGED_OBJECTS
public static final PGProperty HOST_RECHECK_SECONDS
public static final PGProperty JAAS_APPLICATION_NAME
public static final PGProperty JAAS_LOGIN
public static final PGProperty KERBEROS_SERVER_NAME
public static final PGProperty LOAD_BALANCE_HOSTS
public static final PGProperty LOGGER_FILE
File name output of the Logger, if set, the Logger will use a
FileHandler
to write to a specified file. If the parameter is not set
or the file can't be created the ConsoleHandler
will be used instead.
Parameter should be use together with LOGGER_LEVEL
public static final PGProperty LOGGER_LEVEL
Logger level of the driver. Allowed values: OFF
, DEBUG
or TRACE
.
This enable the Logger
of the driver based on the following mapping
of levels:
NOTE: The recommended approach to enable java.util.logging is using a
logging.properties
configuration file with the property
-Djava.util.logging.config.file=myfile
or if your are using an application server
you should use the appropriate logging subsystem.
public static final PGProperty LOGIN_TIMEOUT
public static final PGProperty LOG_SERVER_ERROR_DETAIL
public static final PGProperty LOG_UNCLOSED_CONNECTIONS
public static final PGProperty MAX_RESULT_BUFFER
public static final PGProperty OPTIONS
public static final PGProperty PASSWORD
public static final PGProperty PG_DBNAME
public static final PGProperty PG_HOST
public static final PGProperty PG_PORT
public static final PGProperty PREFER_QUERY_MODE
Specifies which mode is used to execute queries to database: simple means ('Q' execute, no parse, no bind, text mode only), extended means always use bind/execute messages, extendedForPrepared means extended for prepared statements only, extendedCacheEverything means use extended protocol and try cache every statement (including Statement.execute(String sql)) in a query cache.
This mode is meant for debugging purposes and/or for cases when extended protocol cannot be used (e.g. logical replication protocol)
public static final PGProperty PREPARED_STATEMENT_CACHE_QUERIES
0
disables the cache.public static final PGProperty PREPARED_STATEMENT_CACHE_SIZE_MIB
0
disables the cache.public static final PGProperty PREPARE_THRESHOLD
-1
stands for
forceBinarypublic static final PGProperty PROTOCOL_VERSION
public static final PGProperty QUOTE_RETURNING_IDENTIFIERS
public static final PGProperty READ_ONLY
public static final PGProperty READ_ONLY_MODE
Connection.setReadOnly(boolean)
is set to true
.public static final PGProperty RECEIVE_BUFFER_SIZE
-1
, which is the default, means system
default.public static final PGProperty REPLICATION
Connection parameter passed in the startup message. This parameter accepts two values; "true" and "database". Passing "true" tells the backend to go into walsender mode, wherein a small set of replication commands can be issued instead of SQL statements. Only the simple query protocol can be used in walsender mode. Passing "database" as the value instructs walsender to connect to the database specified in the dbname parameter, which will allow the connection to be used for logical replication from that database.
Parameter should be use together with ASSUME_MIN_SERVER_VERSION
with
parameter >= 9.4 (backend >= 9.4)
public static final PGProperty REWRITE_BATCHED_INSERTS
public static final PGProperty SEND_BUFFER_SIZE
-1
, which is the default, means system
default.public static final PGProperty SOCKET_FACTORY
@Deprecated public static final PGProperty SOCKET_FACTORY_ARG
..Factory(Properties)
constructor.public static final PGProperty SOCKET_TIMEOUT
public static final PGProperty SSL
true
values imply sslmode==verify-full
public static final PGProperty SSL_CERT
postgresql.crt
in $HOME/.postgresql
(*nix) or %APPDATA%\postgresql
(windows).public static final PGProperty SSL_FACTORY
javax.net.ssl.SSLSocketFactory
).@Deprecated public static final PGProperty SSL_FACTORY_ARG
..Factory(Properties)
constructor.public static final PGProperty SSL_HOSTNAME_VERIFIER
javax.net.ssl.HostnameVerifier
).public static final PGProperty SSL_KEY
postgresql.pk8
in $HOME/.postgresql
(*nix) or %APPDATA%\postgresql
(windows).public static final PGProperty SSL_MODE
disable
, allow
,
prefer
, require
, verify-ca
, verify-full
.
If ssl
property is empty or set to true
it implies verify-full
.
Default mode is "require"public static final PGProperty SSL_PASSWORD
public static final PGProperty SSL_PASSWORD_CALLBACK
javax.security.auth.callback.CallbackHandler
to use.public static final PGProperty SSL_ROOT_CERT
sslmode
= verify-ca
or verify-full
). Default will be the file root.crt
in $HOME/.postgresql
(*nix) or %APPDATA%\postgresql
(windows).public static final PGProperty SSPI_SERVICE_CLASS
POSTGRES
, is almost always correct.public static final PGProperty STRING_TYPE
unspecified
or varchar
. Default is varchar
for
8.0+ backends.public static final PGProperty TARGET_SERVER_TYPE
public static final PGProperty TCP_KEEP_ALIVE
false
.public static final PGProperty UNKNOWN_LENGTH
public static final PGProperty USER
public static final PGProperty USE_SPNEGO
public static final PGProperty XML_FACTORY_FACTORY
org.postgresql.xml.PGXmlFactoryFactory
.public static PGProperty[] values()
for (PGProperty c : PGProperty.values()) System.out.println(c);
public static PGProperty valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic String getName()
public @Nullable String getDefaultValue()
public boolean isRequired()
public String getDescription()
public String[] getChoices()
public boolean isDeprecated()
public @Nullable String get(Properties properties)
Properties
or the
default value.properties
- properties to take actual value frompublic void set(Properties properties, @Nullable String value)
Properties
.properties
- properties in which the value should be setvalue
- value for this connection parameterpublic boolean getBoolean(Properties properties)
Properties
.properties
- properties to take actual value frompublic int getIntNoCheck(Properties properties)
Properties
. Prefer the
use of getInt(Properties)
anywhere you can throw an SQLException
.properties
- properties to take actual value fromNumberFormatException
- if it cannot be converted to int.public int getInt(Properties properties) throws PSQLException
Properties
.properties
- properties to take actual value fromPSQLException
- if it cannot be converted to int.public @Nullable Integer getInteger(Properties properties) throws PSQLException
Integer
value for this connection parameter in the given Properties
.properties
- properties to take actual value fromPSQLException
- if unable to parse property as integerpublic void set(Properties properties, boolean value)
Properties
.properties
- properties in which the value should be setvalue
- boolean value for this connection parameterpublic void set(Properties properties, int value)
Properties
.properties
- properties in which the value should be setvalue
- int value for this connection parameterpublic boolean isPresent(Properties properties)
Properties
.properties
- set of properties to check current inpublic DriverPropertyInfo toDriverPropertyInfo(Properties properties)
Properties
into a
DriverPropertyInfo
.properties
- properties to take actual value frompublic static @Nullable PGProperty forName(String name)
public @Nullable String getSetString(Properties properties)
properties
- properties bundleCopyright © 1997-2020 PostgreSQL Global Development Group. All Rights Reserved.