0
votes

I cannot connect to my Google Bigquery dataset via Simba JDBC driver. I want to connect from R application using RJDBC package. I set the parameters as follows:

library(RJDBC)

driver <- JDBC(driverClass = "com.simba.googlebigquery.jdbc42.Driver", classPath = "~/JDBC/GoogleBigQueryJDBC42.jar", identifier.quote = "'")

conn <- dbConnect(driver,"jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;ProjectId=My_project_Id;OAuthType=1;")

but I receive an error saying:

Error in .jcall(drv@jdrv, "Ljava/sql/Connection;", "connect", as.character(url)[1],  : 
  java.lang.NoClassDefFoundError: com/google/api/client/json/JsonFactory

Please tell me what I am doing wrong?

1
You have good number of not accepted answers. Be sure to mark answers as accepted (and upvote them as well) when you ask questions on StackOverflow. People may not be motivated to answer future questions otherwise. And ignoring answers doesn’t motivate either!Mikhail Berlyant
if it's R, why not use github.com/rstats-db/bigrquery?Felipe Hoffa

1 Answers

0
votes

I found the problem, I should have add required libraries to Java class-path. So in R I executed the following commands:

 .jaddClassPath("jackson-core-2.1.3.jar")
 .jaddClassPath("google-oauth-client-1.22.0.jar")
 .jaddClassPath("google-http-client-jackson2-1.22.0.jar")
 .jaddClassPath("google-http-client-1.22.0.jar")
 .jaddClassPath("GoogleBigQueryJDBC41.jar")
 .jaddClassPath("google-api-services-bigquery-v2-rev320-1.22.0.jar")
 .jaddClassPath("google-api-client-1.22.0.jar")