Getting Error in .jfindClass(as.character(driverClass)[1]) : class not found


#1

Hi,
Getting error while i run the below script. Attached screenshot. Can anybody help me on this

> library("DBI") 
> library("RJDBC") 
> drv <- JDBC("org.apache.hive.jdbc.HiveDriver", identifier.quote="`") 
Error in .jfindClass(as.character(driverClass)[1]) : class not found 
> .jcall("java/lang/System","S","setProperty","javax.security.auth.useSubjectCredsOnly","false") 
NULL 
> conn <- dbConnect(drv,"jdbc:hive2://usaepapp009r2.acloud.experian.corp:10000/default;principal=hive/[usaepapp009r2.acloud.experian.corp@BDL.GDC.LOCAL](mailto:usaepapp009r2.acloud.experian.corp@BDL.GDC.LOCAL);saslQop=auth-conf") 
Error in dbConnect(drv, "jdbc:hive2://usaepapp009r2.acloud.experian.corp:10000/default;principal=hive/[usaepapp009r2.acloud.experian.corp@BDL.GDC.LOCAL](mailto:usaepapp009r2.acloud.experian.corp@BDL.GDC.LOCAL);saslQop=auth-conf") : 
object 'drv' not found 
> dbGetQuery(conn, "show databases") 
Error in dbGetQuery(conn, "show databases") : object 'conn' not found

Thanks


#2

No screenshot and oddly formatted console log (I think discourse might have auto censored this),
but have you looked into the discussions of this error here:


#3

It looks like everything is dependent on the drv <- JDBC(...) call failing. If "org.apache.hive.jdbc.HiveDriver" is not on your class path by default, you will need to use the classPath argument to JDBC to add the jar file that it comes from to your classpath. Something like:

drv <- RJDBC::JDBC("org.apache.hive.jdbc.HiveDriver", classPath = "/path/to/my/driver.jar", identifier.quote="`")