Closed avinashmaheshjoshi closed 7 years ago
In the dev version, you can just use src_dbi()
.
I tried to use src_dbi() by enabling the dev package in my R Script:
devtools::install_github("tidyverse/dplyr") library(dplyr)
drv <- JDBC("com.my.client.jdbc.Driver","/home/rstudio/projects/jdbc/jdbc.jar") conn <- dbConnect(drv, "jdbc:client://url:5432/rstudio")
Wether scr_dbi(conn) nor crateDb <- dplyr:::src_dbi(conn)
is working: Error in get(name, envir = asNamespace(pkg), inherits = FALSE) : object 'src_dbi' not found
So how can I use JDBC Driver with dplyr?
Thx
@mruepp please ask questions on the manipulatr mailing list, not in GitHub issues.
I was trying to use dplyr in an environment where we have a set of JDBC compliant databases and I need to support all of them. Instead of adding data sources for each of them, it made sense to see if something is available for using JDBC drivers to make database connections and run queries.
Below are the things I have tried,
I tried to get dplyrJDBC package to work - https://github.com/jimhester/dplyrJDBC. I kept getting the error "dbi_connect" not found.
Followed Hadley's comment thread on this issue - https://github.com/hadley/dplyr/issues/329 Where he explains how to add a new data source to dplyr.
If I understood it correctly, the dbi_connect method needs to be implemented for whichever new datasource is to be added. So either the dplyrJDBC package is missing something or something incorrect in the way I am installing it or has the function been updated?
If the dplyrJDBC option doesn't work out, is there a way for me to connect to any JDBC compliant database and use dplyr or just adding each of the data source my only option?