snowflakedb / dplyr-snowflakedb

SnowflakeDB backend for dplyr
Apache License 2.0
65 stars 25 forks source link

Issue connecting to snowflake via dplyr.jdbc.classpath (R - dplyr - jdbc ) #4

Closed richmurnane closed 7 years ago

richmurnane commented 7 years ago

I'm fairly confident this is something I'm doing wrong and this probably isn't a bug, but....

I'm running on AWS Linux, trying to connect to snowflake via R/dplyr and having trouble (JDBC driver not able to connect to Snowflake. Error code: 390100, Message: Incorrect username or password was specified..)

Yet, I can use the same info in jdbc/rjdbc in the following and it works (direct connect, no dplyr, just jdbc), ideas? Note I've not included actual passwords/usernames/etc. here...

--works

if (!require("RJDBC")) {
 install.packages("RJDBC",repos="http://cran.rstudio.com/")
 library("RJDBC")
 }
jdbcDriver <- JDBC(driverClass="com.snowflake.client.jdbc.SnowflakeDriver", classPath="~/jdbc/snowflake-jdbc-3.1.1.jar")
 jdbcConnection <- dbConnect(jdbcDriver, "jdbc:snowflake://xxxxx.us-east-1.snowflakecomputing.com", "userID","Password")
 result <- dbGetQuery(jdbcConnection, "select current_timestamp() as now")
 print(result)
 dbDisconnect(jdbcConnection)

> print(result)
              NOW
1 2017-07-21 11:52:02.556 -0700
--failed
> library(dplyr.snowflakedb)
> options(dplyr.jdbc.classpath = "~/jdbc/snowflake-jdbc-3.1.1.jar")
> my_db <- src_snowflakedb(user = "userID",
+                password = "Password",
+                account = "xxxxx.us-east-1",
+                opts = list(warehouse = "PROJECT_WH_90", db = "PROJECT", schema = "DEV"))
host:
URL: jdbc:snowflake://xxxxx.us-east-1.snowflakecomputing.com:443/?account=xxxxx.us-east-1&warehouse=PROJECT_WH_90&db=PROJECT&schema=DEV
Error in .jcall(drv@jdrv, "Ljava/sql/Connection;", "connect", as.character(url)[1], :
 net.snowflake.client.jdbc.SnowflakeSQLException: JDBC driver not able to connect to Snowflake. Error code: 390100, Message: Incorrect username or password was specified..
>

--disclaimer: my password has a special character in it, does that matter?

--references: https://github.com/snowflakedb/dplyr-snowflakedb https://www.snowflake.net/integrating-the-snowflake-data-warehouse-with-r-via-dplyr/ https://rviews.rstudio.com/2017/05/17/databases-using-r/

--R version

R version 3.3.2 (2016-10-31) -- "Sincere Pumpkin Patch"
Platform: x86_64-redhat-linux-gnu (64-bit)
richmurnane commented 7 years ago

please close issue as apparently this library is no longer active...Rich

dplyr.snowflakedb