Menu
Amazon Redshift
Management Guide (API Version 2012-12-01)

JDBC Driver Configuration Options

To control the behavior of the Amazon Redshift JDBC driver, you can append the configuration options described in the following table to the JDBC URL. For example, the following JDBC URL connects to your cluster using Secure Socket Layer (SSL) without using a server certificate.

Copy
jdbc:redshift://examplecluster.abc123xyz789.us-west-2.redshift.amazonaws.com:5439/dev?ssl=true&sslfactory=com.amazon.redshift.ssl.NonValidatingFactory

For more information about SSL options, see Connect Using SSL.

JDBC Option Matching PostgreSQL Option Exists? Default Value Description
AuthMech No DISABLE

The authentication mechanism to use. The following values are possible:

  • DISABLE—Establish a non-SSL connection.

  • ALLOW—Attempt to establish a non-SSL connection. If the connection fails, then attempt an SSL connection.

  • REQUIRE—Establish an SSL connection.

  • PREFER—Attempt to establish an SSL connection. If the connection fails, then attempt a non-SSL connection.

BlockingRowsMode No 0 The number of rows to hold in memory. After one row is discarded, another row is loaded in its place.
DisableIsValidQuery No false

By default, DisableIsValidQuery is set to False, which enables the java Connection.isValid() method to detect when the JDBC driver no longer has a valid database connection, even if the database connection has terminated unexpectedly. With Amazon Redshift JDBC drivers prior to version 1.2.1, isValid() did not reliably detect when a valid connection was lost. To restore the behavior observered in earlier drivers, set DisableIsValidQuery to true.

DSILogLevel No 0

Enable logging and specify the amount of detail included in log files. The following table lists the logging detail levels.

  • 0 – Disable all logging.

  • 1 – Log severe error events that will lead the driver to abort.

  • 2 – Log error events that might allow the driver to continue running.

  • 3 – Log potentially harmful situations.

  • 4 – Log general information that describes the progress of the driver.

  • 5 – Log detailed information that is useful for debugging the driver.

  • 6 – Log all driver activity.

FilterLevel No NOTICE

The minimum severity level of a message that the client will process. The following values are possible, in order from lowest to highest severity:

  • DEBUG

  • INFO

  • NOTICE

  • WARNING

  • LOG

  • ERROR

loginTimeout Yes 0

The number of seconds to wait before timing out when connecting to the server. If establishing the connection takes longer than this threshold, then the connection is aborted.

When this property is set to the default value of 0, connections do not time out.

loglevel Yes null

The amount of logging information output by the driver. By default, no logging is performed. Information will be output to the location specified by the LogStream or LogValue option in the driver manager. The following values are possible:

  • 2 (DEBUG)—Log a lot of detailed information.

  • 1 (INFO)—Log fewer details.

Note

Use this property only if you are troubleshooting problems with a driver, because it can affect performance.

OpenSourceSubProtocolOverride No false

When enabled, this setting prevents potential conflicts between the Amazon Redshift JDBC driver and a PostgreSQL JDBC driver. If your application simultaneously connects to your cluster using the Amazon Redshift JDBC driver and to other data sources using a PostgreSQL JDBC driver, append this connection attribute to the JDBC URL that you use to connect to your PostgreSQL data sources. The following values are possible:

  • true—Enable OpenSourceSubProtocolOverride.

  • false—Disable OpenSourceSubProtocolOverride.

PWD Yes null The password to use to connect to the Amazon Redshift server.
socketTimeout Yes 0

The number of seconds to wait during socket read operations before timing out. If an operation takes longer than this threshold, then the connection is closed.

When this property is set to the default value of 0, connections do not time out.

ssl Yes false

A value that determines whether to use an SSL connection. The following values are possible:

  • true—Use SSL.

  • false—Don't use SSL.

sslCert No null

The full path of a .pem or .crt file containing additional trusted CA certificates for verifying a proxy server when using SSL. This option is required only if sslKey is specified.

sslFactory Yes null

The factory to use for an SSL connection without a server certificate. The following values are possible:

  • com.amazon.redshift.ssl.NonValidatingFactory

  • org.postgresql.ssl.NonValidatingFactory

sslKey No null

The full path of a .der file containing the PKCS8 key file for verifying the certificates specified by the sslCert option. This option is required only if sslCert is specified.

sslMode Yes null

A setting that determines how to handle server certificate verification. The following values are possible:

  • verify-ca—SSL must be used and the server certificate must be verified.

  • verify-full—SSL must be used. The server certificate must be verified and the server hostname must match the hostname attribute on the certificate.

If sslMode is not specified, a server certificate is not required.

For more information about sslMode options, see Using SSL and Server Certificates in Java.

sslRootCert No null

The full path of a .pem or .crt file containing the root Certificate Authority (CA) certificate for verifying a proxy server when using SSL.

sslPassword No null

The password for the encrypted key file specified in the sslKey option. This option is required only if sslKey is specified and the .der file is encrypted.

tcpKeepAlive Yes true

A value that determines whether TCP keepalives are enabled. The following values are possible:

  • true—Enable TCP keepalives.

  • false—Disable TCP keepalives.

TCPKeepAliveMinutes No 5

The threshold for minutes of inactivity before initiating a TCP keepalive transmission.

UID Yes null The user name to use to connect to the Amazon Redshift server.