Connect IntelliJ to Amazon Redshift

Question:

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?

Answer:

  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}>]

Leave a Reply