简体   繁体   English

RJDBC与R中的Amazon Redshift的连接

[英]RJDBC Connection to Amazon Redshift in R

I tried to create JDBC connection with Amazon Redshift in R. Following the instruction under https://aws.amazon.com/blogs/big-data/connecting-r-with-amazon-redshift/ , I created the following: 我试图在R中与Amazon Redshift创建JDBC连接。按照https://aws.amazon.com/blogs/big-data/connecting-r-with-amazon-redshift/下的说明,我创建了以下内容:

driver <- JDBC("com.amazon.redshift.jdbc42.Driver", "RedshiftJDBC42-1.2.1.1001.jar", identifier.quote="`")

url <- "jdbc:redshift://xxxxxx.us-east-1.redshift.amazonaws.com
:5439/user=xxx&password=xxx"

conn <- dbConnect(driver, url)

Everything works except that the last row gave me the error message of the following: 一切正常,除了最后一行给我以下错误消息:

Error in .jcall(drv@jdrv, "Ljava/sql/Connection;", "connect", as.character(url)[1], : java.sql.SQLNonTransientConnectionException: Error message not found: CONNECTION_REFUSED. Can't find bundle for base name com.amazon.dsi.core.impl.JDBCMessages, locale en .jcall(drv @ jdrv,“ Ljava / sql / Connection;”,“ connect”,as.character(url)[1]中的错误:java.sql.SQLNonTransientConnectionException:找不到错误消息:CONNECTION_REFUSED。找不到基本名称com.amazon.dsi.core.impl.JDBCMessages的语言包,语言环境

Any thoughts? 有什么想法吗?

I had the error but got it working. 我有错误,但可以正常工作。 Things I did included : 我所做的事情包括:

  1. used .jclassLoader()$setDebug(1L) to get full debug info of jar 使用.jclassLoader()$ setDebug(1L)获取jar的完整调试信息
    load - this showed path it was checking 负载-这显示了它正在检查的路径
  2. downloaded latest jar from amazon s3 (manually not with R) 从亚马逊s3下载最新的jar(通常不使用R)
  3. moved the latest jar into the path that was being checked in a) 将最新的jar移至正在检查的路径中
  4. used real redshift instance being used by my team with good credentials 使用了真实的redshift实例,并由我的团队以良好的信誉使用

Voila it worked ! 瞧,它奏效了!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM