Error related to 'rJava' and 'RJDBC'


#1

Hello RStudio Community!

I have installed the 'rJava' and 'RJDBC' packages in order to connect to a Vertica database. While I had some issues getting the packages to load, I have resolved them.

However, in an attempt to actually execute one of their functions, I am facing a new error. The code that I am running is:

drv <- JDBC(
  driverClass = "com.vertica.jdbc.Driver",
  classPath = Sys.getenv("classPath")

The error that I am receiving is:

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

Could someone please advise? Thank you!


#2

It's been a while since I have had the "pleasure" of using rJava. It sounds like the "com.vertica.jdbc.Driver" class is not on your class path. If you can find the .jar that has that class in it and then include that .jar file in the class path, I think that should resolve your issue.