Reputation: 103
I am trying to set up an ODBC connection on RHEL to connect to a redshift cluster. I have installed the latest Redshift ODBC driver, and modified the odbc.ini file to include the necessary details:
[ODBC Data Sources]
Redshift_Connection=Amazon Redshift (x64)
[Redshift_Connection]
Driver=/u01/redshift/lib/64/libamazonredshiftodbc64.so
#Driver=/u01/redshift/lib/32/libamazonredshiftodbc32.so
Description=Amazon Redshift ODBC Driver (64-bit) DSN
Server=****
Port=****
Database=****
locale=en-US
When trying to connect - I get the following error:
{error} STATE=42704, CODE=34772055228426,
MSG=[Amazon][Amazon Redshift] (10) Error occurred while trying to connect:
[SQLState 42704] FATAL: unrecognized configuration parameter "driver_version"
However, 'driver_version' is not a configuration parameter the odbc.ini file. There is additionally an odbcinst.ini file , but that also does not contain it.
I have tried setting a new parameter 'driver_version' and setting it the version of the Redshift ODBC, however that doesn't work either, as well as tried the 32bit driver (that was a hail mary).
Is there any other location that this 'driver_version' parameter could be coming from? Am stuck until I can get this connection working.
The ODBC driver version is 1.4.20, direct from AWS website
Redshift is PostgreSQL 8.0.2 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.4.2 20041017 (Red Hat 3.4.2-6.fc3), Redshift 1.0.22169
Upvotes: 3
Views: 1678
Reputation: 36
It appears that in the com.amazon.redshift.core.v3.ConnectionFactoryImpl.getParametersForStartup there is a parameter that is passed in to load the driver version parameters. This ConnectionFactoryImpl utilizes the com.amazon.redshift.util.DriverInfo class, which pulls the version from this file: redshift_jdbc_driver.properties or sets it by default to the version that you are using. These parameters look to be encoded and passed along, which seem to be the cause of the failure.
You could try to create your own Datasource by setting the properties you want, however that did not work for me.
Edit - For me I am using Spring Boot, I had to remove the @Configuration annotation from the Configuration class, in order to bypass these extra settings.
Upvotes: 0