Want to Connect redshift to R

佐手、 提交于 2019-12-24 13:59:04

问题


I tried to use the code from this link but I got an error

driver <- JDBC("com.amazon.redshift.jdbc41.Driver", "RedshiftJDBC41-1.1.9.1009.jar", identifier.quote="`") JavaVM: requested Java version ((null)) not available. Using Java at "" instead. JavaVM: Failed to load JVM: /bundle/Libraries/libserver.dylib JavaVM FATAL: Failed to load the jvm library. Error in .jinit(classPath) : JNI_GetCreatedJavaVMs returned -1

After loading the driver and trying to connect. I don't know how to connect Redshift to R.


回答1:


This will not solve the error, but if you want to connect to Redshift from R, you can use RPostgreSQL library. as in the answer in another R-Redshift connection issue

library (RPostgreSQL)
drv <- dbDriver("PostgreSQL")
conn <- dbConnect(drv, host="your.host.us-east-1.redshift.amazonaws.com", 
             port="5439",
             dbname="your_db_name", 
             user="user", 
             password="password")

You also need to make sure that your IP is Redshift security group white list.



来源:https://stackoverflow.com/questions/35706832/want-to-connect-redshift-to-r

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!