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), user (UID), and password (PWD).

Copy
jdbc:redshift://examplecluster.abc123xyz789.us-west-2.redshift.amazonaws.com:5439/dev?ssl=true&UID=your_username&PWD=your_password

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

JDBC Option Matching PostgreSQL Option Exists? Default Value Description
AccessKeyID No null The access key ID for the IAM role or IAM user configured for IAM database authentication. The AccessKeyID option is part of a set of options used to configure IAM database authentication. For more information, see JDBC and ODBC Options for Providing IAM Credentials. AccessKeyID and SecretAccessKey must be specified together.
AuthMech No DISABLE

Deprecated. By default, Amazon Redshift drivers use SSL. Use ssl and sslmode instead.

AutoCreate No false Specify true to create a database user with the name specified for DbUser if one does not exist. The AutoCreate option is part of a set of options used to configure IAM database authentication. For more information, see JDBC and ODBC Options for Creating Database User Credentials.
BlockingRowsMode No 0 The number of rows to hold in memory. After one row is discarded, another row is loaded in its place.
DbGroups No null A comma-delimited list of the names of existing database groups the database user joins for the current session. The DbGroups option is part of a set of options used to configure IAM database authentication. For more information, see JDBC and ODBC Options for Creating Database User Credentials.
DbUser No null The name of a database user. The DbUser option is part of a set of options used to configure IAM database authentication. For more information, see JDBC and ODBC Options for Creating Database User Credentials.
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 observed 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 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 processes. 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. In some cases, your application might simultaneously connect to your cluster using the Amazon Redshift JDBC driver and to other data sources using a PostgreSQL JDBC driver. In this case, 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.

Plugin_Name No null The fully qualified class name that implements a credentials provider. The Plugin_Name option is part of a set of options used to configure IAM database authentication. For more information, see Using a Credentials Provider Plugin.
Profile No null The name of a profile in an AWS credentials or config file that contains values for the JDBC connection options. The Plugin_Name option is part of a set of options used to configure IAM database authentication. For more information, see Using a Configuration Profile.
PWD Yes null The password to use to connect to the Amazon Redshift server.
SecretAccessKey No null The secret access key for the IAM role or IAM user configured for IAM database authentication. The SecretAccessKey option is part of a set of options used to configure IAM database authentication. For more information, see JDBC and ODBC Options for Providing IAM Credentials. AccessKeyID and SecretAccessKey must be specified together.
SessionToken No null The temporary session token for the IAM role configured for IAM database authentication. SessionToken is not required when IAM database authentication is configured for an IAM user. The SessionToken option is part of a set of options used to configure IAM database authentication. For more information, see JDBC and ODBC Options for Providing IAM Credentials. If SessionToken is used, AccessKeyID and SecretAccessKey must also be specified.
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 true

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

  • true—Use SSL.

  • false—Don't use SSL.

The driver sets ssl to true by default. If ssl is explicitly set to false with IAM authentication, the connection attempt fails.

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.

Important

Amazon Redshift has changed the way that we manage SSL certificates. If you must use a driver version earlier than 1.2.8.1005, you might need to update your current trust root CA certificates to continue to connect to your clusters using SSL. For more information, see Transitioning to ACM Certificates for SSL Connections.

sslRootCert No null

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

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.