Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connect IntelliJ to Amazon Redshift

I'm using the latest version of IntelliJ and I've just created a cluster in Amazon Redshift. How do I connect IntelliJ to Redshift so that I can query it from my favorite IDE?

like image 263
RyanHennig Avatar asked Aug 31 '15 20:08

RyanHennig


2 Answers

  1. Download a jdbc driver: http://docs.aws.amazon.com/redshift/latest/mgmt/configure-jdbc-connection.html#download-jdbc-driver
  2. On IntelliJ: View |Tool Windows | Database
  3. Click on "Data Source Properties" (enter image description here)
  4. Click Add (+) and select "Database Driver":

enter image description here

  1. Uncheck "JDBC drivers", and add a jdbc driver, select a class from the dropdown and select a PostgreSQL dialect: enter image description here

    6.Add a new connection, and use this datasource for your connection: (+ | Data Source | RedShift).

    7.Set URL templates:

    • jdbc:redshift://[{host::localhost}[:{port::5439}]][/{database::postgres}?][\?<&,user={user:param},password={password:param},{:identifier}={:param}>]

    • jdbc:redshift://\[{host:ipv6:\:\:1}\][:{port::5439}][/{database::postgres}?][\?<&,user={user:param},password={password:param},{:identifier}={:param}>]

    • jdbc:redshift:{database::postgres}[\?<&,user={user:param},password={password:param},{:identifier}={:param}>]
like image 86
Daniel Avatar answered Oct 16 '22 10:10

Daniel


You can connect IntelliJ to Redshift by the using the JDBC Driver supplied by Amazon. In the Redshift Console, go to "Connect Client" to get the driver.

Then, in the IntelliJ Data Source window, add the JAR as a Driver file, and use the following settings:

  • Class: com.amazon.redshift.jdbc41.Driver
  • URL template: jdbc:redshift://{host}:{port}/{database}

Common Pitfalls:

  • If the driver file is not readable or marked as in quarantine by OS X, you won't be able to select the driver class.

For a more detailed guide, see this blog post: Connecting IntelliJ to Redshift

Note: There is no native Redshift support in IntelliJ yet. IntelliJ Issue DBE-1459

like image 4
RyanHennig Avatar answered Oct 16 '22 09:10

RyanHennig