0

Connect R and Teradata using JDBC

I've followed the steps above and run into an error after the first step:

Error in .jfindClass(as.character(driverClass)[1]) :
java.lang.ClassNotFoundException

Yes, I have the jdbc driver downloaded and the files stored in the directory listed. rJava and RJDBC packages installed and loaded too.

EDIT: The following block of code:

drv = JDBC("com.teradata.jdbc.TeraDriver", c("\\Users\\bo762818\\Downloads\\TeraJDBC__indep_indep.16.20.00.08\\tdgssconfig.jar",
                                         "\\Users\\bo762818\\Downloads\\TeraJDBC__indep_indep.16.20.00.08\\terajdbc4.jar"))

yields the below error:

Error in .jfindClass(as.character(driverClass)[1]) :
java.lang.ClassNotFoundException

Ranalytictsnewb
  • 105
  • 1
  • 1
  • 12
  • drv = JDBC("com.teradata.jdbc.TeraDriver","C:\terajdbc.jar;C:\terajdbc\tdgssconfig.jar") – Ranalytictsnewb Aug 22 '18 at 17:44
  • done, for some reason, the double backslashes show up in my code, but not in the original post – Ranalytictsnewb Aug 22 '18 at 17:52
  • Do you really have .jars at those referenced paths? They look exactly like the linked question. Navigate to those folders and check. Usually, software are downloaded in "Program Files" not root of C drive. Also, you have a double `.jar.jar`. – Parfait Aug 22 '18 at 17:55
  • Ok, that was a typo. Same problem removing the double .jar.jar - and yes I moved them to that location so I could copy/paste from the example. – Ranalytictsnewb Aug 22 '18 at 18:00
  • I would carefully check those paths again. The linked question is over 4 years old and you might have a different jdbc version and the name slightly changed. You should NOT change original, downloaded filename. BTW - you can reference the .jar paths ANYWHERE on you computer. Do not tailor just for the question. – Parfait Aug 22 '18 at 18:14
  • I re-downloaded the driver and used the paths from where they downloaded into, same problem. All the documentation I can find shows the same format – Ranalytictsnewb Aug 22 '18 at 18:44
  • See similar, more updated [question](https://stackoverflow.com/questions/49132249/r-jdbc-not-finding-java-drivers-path-when-connecting-to-teradata) where you can bind .jars with `c()`. One again, I truly believe your issue is paths are not correctly specified. Please post longer error traceback. – Parfait Aug 22 '18 at 18:52
  • Added the edited code in original post. Same error. Do I have my slashes wrong? When I copy the file path, they come in as single forward slashes so I change to double backslashes as shown – Ranalytictsnewb Aug 22 '18 at 19:11
  • 2
    Are you using Windows or Linux/Mac machine? Stop borrowing other code and use your own. The OS does matter. Please post your exact code, the output of `sessionInfo()`, and your **full** error traceback. Even test paths with `file.exists` like the linked question does. Help us help you. – Parfait Aug 22 '18 at 20:12
  • `\\Users\\bo762818\\Downloads\\...` looks like an invalid path to me, are you sure it shouldn't be `C:\\Users\\bo762818\\Downloads\\...`? – Mark Rotteveel Aug 23 '18 at 09:41

0 Answers0