Skip to content

How do I upgrade my Amazon Redshift JDBC or ODBC driver?

3 minute read
0

I want to upgrade to the latest Java Database Connectivity (JDBC) or Open Database Connectivity (ODBC) driver to connect to my Amazon Redshift cluster.

Resolution

To avoid issues with earlier driver versions, it's a best practice to use the latest Amazon Redshift drivers. When there are known driver issues or major changes, AWS sends an email that notifies you to update your driver to the latest version.

Note: A driver upgrade involves changes to only the client-side SQL data or application that tries to connect to Amazon Redshift. So, you don't need to modify your Amazon Redshift cluster.

JDBC upgrades

To upgrade your JDBC driver in Amazon Redshift, complete the following steps:

  1. Run the following command to check the current JDBC driver version:

    SELECT DISTINCT trim(remotehost) remote_host,trim(driver_version) jdbc_version,
    MAX(recordtime) OVER (PARTITION BY driver_version) last_time_loggedin
    FROM stl_connection_log
    WHERE driver_version LIKE '%JDBC%'
    AND trim(event) = 'set application_name'
    ORDER BY 2 DESC;

    Note: Use the IP address in the output to identify the client machine.

  2. Determine whether you need a 32-bit or 64-bit version.

  3. Download the Amazon Redshift JDBC driver.

  4. Check whether the driver contains the AWS SDK.
    Note: You can find the driver version number in the driver file name. For example, for RedshiftJDBC42-no-awssdk-1.2.34.1058.jar use the JDBC 4.2 compatible driver without an AWS SDK. The driver version is 1.2.34.1058. You can use AWS Identity and Access Management (IAM) credentials and JDBC to authenticate to Amazon Redshift. If you must use the AWS SDK, then download a JDBC driver that includes AWS SDK for Java, or download only the AWS SDK.

  5. (Optional) If you use SQL Workbench/J, then select the existing driver and remove it. Choose the folder icon and provide the download location of the latest driver. Then, choose OK to update your driver.

ODBC upgrades

Install and configure the ODBC connection.

Then, take one of the following actions based on your operating system (OS) to verify the ODBC driver version.

Microsoft Windows

On the Start menu, navigate to ODBC Data Sources, and then choose the Drivers tab. Locate the Amazon Redshift ODBC driver from the list of installed ODBC drivers. The version number appears in the Version column. Be sure to choose the ODBC Data Source Administrator that has the same bitness as the client application that you use to connect to Amazon Redshift.

macOS

At the terminal, run the pkgutil --info com.amazon.redshiftodbc command.

Linux

Depending on your package manager, run one of the following commands:

yum list | grep AmazonRedshiftODBC

-or-

rpm -qa | grep AmazonRedshiftODBC

Gradual driver updates

To gradually update your JDBC or ODBC driver, complete the following steps:

  1. Replace the old driver with the new one. If an application explicitly points to an old driver file name, then reconfigure the application and use the new driver for 3-5 days.
  2. If the driver upgrade didn't affect your cluster, then replace the additional SQL client. Check how the new client performs for 3-5 days, and then determine whether it affected your cluster.
  3. Gradually continue to replace the driver until all the SQL clients update to the latest version.

Additional troubleshooting

If you experience issues during your upgrade, then take the following actions:

AWS OFFICIALUpdated a year ago