public enum PGProperty extends java.lang.Enum<PGProperty>
Enum Constant and Description |
---|
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
|
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.
|
CHARSET
The character set to use for data sent to the database or received
from the database.
|
COMPATIBLE
Force compatibility of some features with an older version of the driver.
|
CONNECT_TIMEOUT
The timeout value used for socket connect operations.
|
CURRENT_SCHEMA
Specify the schema to be set in the search-path.
|
DEFAULT_ROW_FETCH_SIZE
Default parameter for
Statement.getFetchSize() . |
DISABLE_COLUMN_SANITISER
Enable optimization that disables column name sanitiser.
|
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.
|
HOST_RECHECK_SECONDS |
JAAS_APPLICATION_NAME
Specifies the name of the JAAS system or application login configuration.
|
KERBEROS_SERVER_NAME
The Kerberos service name to use when authenticating with GSSAPI.
|
LOAD_BALANCE_HOSTS |
LOG_LEVEL
The loglevel.
|
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.
|
LOGIN_TIMEOUT
Specify how long to wait for establishment of a database connection.
|
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)
|
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.
|
READ_ONLY
Puts this connection in read-only mode.
|
RECEIVE_BUFFER_SIZE
Socket read buffer size (SO_RECVBUF).
|
SEND_BUFFER_SIZE
Socket write buffer size (SO_SNDBUF).
|
SOCKET_TIMEOUT
The timeout value used for socket read operations.
|
SSL
Control use of SSL (any non-null value causes SSL to be required).
|
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
The String argument to give to the constructor of the SSL Factory
|
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.
|
Modifier and Type | Method and Description |
---|---|
static PGProperty |
forName(java.lang.String name) |
java.lang.String |
get(java.util.Properties properties)
Returns the value of the connection parameters according to the given
Properties or the
default value |
boolean |
getBoolean(java.util.Properties properties)
Return the boolean value for this connection parameter in the given
Properties |
java.lang.String[] |
getChoices()
Returns the available values for this connection parameter
|
java.lang.String |
getDefaultValue()
Returns the default value for this connection parameter
|
int |
getInt(java.util.Properties properties)
Return the int value for this connection parameter in the given
Properties |
java.lang.Integer |
getInteger(java.util.Properties properties)
Return the
Integer value for this connection parameter in the given Properties |
int |
getIntNoCheck(java.util.Properties properties)
Return the int value for this connection parameter in the given
Properties . |
java.lang.String |
getName()
Returns the name of the connection parameter.
|
boolean |
isPresent(java.util.Properties properties)
Test whether this property is present in the given
Properties |
void |
set(java.util.Properties properties,
boolean value)
Set the boolean value for this connection parameter in the given
Properties |
void |
set(java.util.Properties properties,
int value)
Set the int value for this connection parameter in the given
Properties |
void |
set(java.util.Properties properties,
java.lang.String value)
Set the value for this connection parameter in the given
Properties |
java.sql.DriverPropertyInfo |
toDriverPropertyInfo(java.util.Properties properties)
Convert this connection parameter and the value read from the given
Properties into
a DriverPropertyInfo |
static PGProperty |
valueOf(java.lang.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 PG_DBNAME
public static final PGProperty PG_HOST
public static final PGProperty PG_PORT
public static final PGProperty USER
public static final PGProperty PASSWORD
public static final PGProperty PROTOCOL_VERSION
public static final PGProperty LOG_LEVEL
Driver.DEBUG
, Driver.INFO
, Driver.OFF
.public static final PGProperty PREPARE_THRESHOLD
-1
stands for forceBinarypublic 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 DEFAULT_ROW_FETCH_SIZE
Statement.getFetchSize()
. A value of 0
means that need fetch all rows at oncepublic static final PGProperty BINARY_TRANSFER
public static final PGProperty COMPATIBLE
public static final PGProperty READ_ONLY
public static final PGProperty BINARY_TRANSFER_ENABLE
public static final PGProperty BINARY_TRANSFER_DISABLE
public static final PGProperty STRING_TYPE
unspecified
or varchar
. Default is varchar
for 8.0+ backends.public static final PGProperty UNKNOWN_LENGTH
public static final PGProperty LOG_UNCLOSED_CONNECTIONS
public static final PGProperty DISABLE_COLUMN_SANITISER
public static final PGProperty SSL
public static final PGProperty SSL_MODE
require
, verify-ca
, verify-full
, or disable
(allow
and prefer
are not implemented)
If not set, the ssl
property may be checked to enable SSL mode.public static final PGProperty SSL_FACTORY
javax.net.ssl.SSLSocketFactory
).public static final PGProperty SSL_FACTORY_ARG
public static final PGProperty SSL_HOSTNAME_VERIFIER
javax.net.ssl.HostnameVerifier
).public static final PGProperty SSL_CERT
postgresql.crt
in $HOME/.postgresql
(*nix) or %APPDATA%\postgresql
(windows).public static final PGProperty SSL_KEY
postgresql.pk8
in $HOME/.postgresql
(*nix) or %APPDATA%\postgresql
(windows).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 SSL_PASSWORD
public static final PGProperty SSL_PASSWORD_CALLBACK
javax.security.auth.callback.CallbackHandler
to usepublic static final PGProperty TCP_KEEP_ALIVE
false
.public static final PGProperty LOGIN_TIMEOUT
public static final PGProperty CONNECT_TIMEOUT
The timeout is specified in seconds and a value of zero means that it is disabled.
public static final PGProperty SOCKET_TIMEOUT
public static final PGProperty RECEIVE_BUFFER_SIZE
-1
, which is the default, means system default.public static final PGProperty SEND_BUFFER_SIZE
-1
, which is the default, means system default.public static final PGProperty ASSUME_MIN_SERVER_VERSION
public static final PGProperty APPLICATION_NAME
public static final PGProperty JAAS_APPLICATION_NAME
public static final PGProperty KERBEROS_SERVER_NAME
public static final PGProperty USE_SPNEGO
public static final PGProperty GSS_LIB
public static final PGProperty SSPI_SERVICE_CLASS
POSTGRES
, is almost always correct.public static final PGProperty CHARSET
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 CURRENT_SCHEMA
public static final PGProperty TARGET_SERVER_TYPE
public static final PGProperty LOAD_BALANCE_HOSTS
public static final PGProperty HOST_RECHECK_SECONDS
public static PGProperty[] values()
for (PGProperty c : PGProperty.values()) System.out.println(c);
public static PGProperty valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant
with the specified namejava.lang.NullPointerException
- if the argument is nullpublic java.lang.String getName()
public java.lang.String getDefaultValue()
public java.lang.String[] getChoices()
public java.lang.String get(java.util.Properties properties)
Properties
or the
default valueproperties
- properties to take actual value frompublic void set(java.util.Properties properties, java.lang.String value)
Properties
properties
- properties in which the value should be setvalue
- value for this connection parameterpublic boolean getBoolean(java.util.Properties properties)
Properties
properties
- properties to take actual value frompublic int getIntNoCheck(java.util.Properties properties)
Properties
.
Prefer the use of getInt(Properties)
anywhere you can throw an SQLException
properties
- properties to take actual value fromjava.lang.NumberFormatException
- if it cannot be converted to int.public int getInt(java.util.Properties properties) throws org.postgresql.util.PSQLException
Properties
properties
- properties to take actual value fromorg.postgresql.util.PSQLException
- if it cannot be converted to int.public java.lang.Integer getInteger(java.util.Properties properties) throws org.postgresql.util.PSQLException
Integer
value for this connection parameter in the given Properties
properties
- properties to take actual value fromorg.postgresql.util.PSQLException
public void set(java.util.Properties properties, boolean value)
Properties
properties
- properties in which the value should be setvalue
- boolean value for this connection parameterpublic void set(java.util.Properties properties, int value)
Properties
properties
- properties in which the value should be setvalue
- int value for this connection parameterpublic boolean isPresent(java.util.Properties properties)
Properties
public java.sql.DriverPropertyInfo toDriverPropertyInfo(java.util.Properties properties)
Properties
into
a DriverPropertyInfo
properties
- properties to take actual value frompublic static PGProperty forName(java.lang.String name)