将IntelliJ连接到Amazon Redshift

Rya*_*nig 6 intellij-idea amazon-web-services amazon-redshift

我正在使用最新版本的IntelliJ,我刚刚在Amazon Redshift中创建了一个集群.如何将IntelliJ连接到Redshift以便我可以从我最喜欢的IDE中查询它?

Dan*_*iel 7

  1. 下载jdbc驱动程序:http: //docs.aws.amazon.com/redshift/latest/mgmt/configure-jdbc-connection.html#download-jdbc-driver
  2. 在IntelliJ上: View |Tool Windows | Database
  3. 单击"数据源属性"(在此输入图像描述)
  4. 单击添加(+)并选择"数据库驱动程序":

在此输入图像描述

  1. 取消选中"JDBC驱动程序",然后添加一个jdbc驱动程序,从下拉列表中选择一个类并选择一个PostgreSQL方言: 在此输入图像描述

    6.添加新连接,并使用此数据源进行连接:( + | Data Source | RedShift).

    7.设置URL模板:

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


Rya*_*nig 4

您可以使用 Amazon 提供的 JDBC 驱动程序将 IntelliJ 连接到 Redshift。在 Redshift 控制台中,转到“Connect Client”以获取驱动程序。

然后,在 IntelliJ Data Source 窗口中,将 JAR 添加为驱动程序文件,并使用以下设置:

  • 类:com.amazon.redshift.jdbc41.Driver
  • URL 模板:jdbc:redshift://{主机}:{端口}/{数据库}

常见陷阱:

  • 如果驱动程序文件不可读或被 OS X 标记为隔离,您将无法选择驱动程序类。

有关更详细的指南,请参阅此博客文章:将 IntelliJ 连接到 Redshift

注意:IntelliJ 中尚无原生 Redshift 支持。 IntelliJ 问题 DBE-1459