baztian / jaydebeapi

JayDeBeApi module allows you to connect from Python code to databases using Java JDBC. It provides a Python DB-API v2.0 to that database.
GNU Lesser General Public License v3.0
366 stars 149 forks source link

Issues connecting to Redshift #69

Open leoruhesh opened 6 years ago

leoruhesh commented 6 years ago

Unable to connect to RedshiftDB using the Redshift JDBC driver ( versions 4.2/4.1/4.0 ).

When trying to connect to Redshift DB using jaydebeapi.connect(jclassname='com.amazon.redshift.jdbc.Driver', url=str('jdbc:redshift://endpoint:port/database?UID=user&PWD=password'),jars='/path-to-RedshiftJDBC4-1.2.12.1017.jar') the below error is thrown.

return jpype.java.sql.DriverManager.getConnection(url, *dargs) jpype._jexception.NoClassDefFoundErrorPyRaisable: java.lang.NoClassDefFoundError: Lcom/amazon/redshift/core/jdbc42/S42NotifiedConnection;

Tried 4.2/4.1/4.0 version of Redshift Drivers. Successfully able to connect using tools like Sql WorkBench.

bgood commented 6 years ago

I'm having the same issue.

Any updates on this?

Mikuana commented 6 years ago

Same. I'm trying to connect via SSO and getting this error.

kathir2903 commented 6 years ago

Hi @leoruhesh @bgood , Issue is fixed in 1.2.15 Here is the link to download - https://s3.amazonaws.com/redshift-downloads/drivers/jdbc/1.2.15.1025/RedshiftJDBC42-no-awssdk-1.2.15.1025.jar

Documentation - https://docs.aws.amazon.com/redshift/latest/mgmt/configure-jdbc-connection.html

Mikuana commented 6 years ago

@kathir2903 I may not understand the solution that you're suggesting, but I downloaded the new driver and I still get the same error. Both the no sdk and full sdk versions fail to authenticate via SSO. Did you update anything else to resolve this?

kathir2903 commented 6 years ago

@Mikuana , The issue @leoruhesh have seen first was different than SSO. That issue is fixed in RedshiftJDBC42-no-awssdk-1.2.15.1025.jar, because I have tried the 1.2.15.1025 and it is working for me. SSO auth issue is a different issue