[R] RJDBC cant find driver class in JDBC jar file

Dan Montgomery damontgomery at gmail.com
Tue Jun 3 00:31:34 CEST 2008


I would like to set up a Windows XP environment with R and MySQL.
This set-up was recommended by a friend who uses this set up, but I
have been unable to get RJDBC to work.  I have installed all of the
software today (June 2 2008), first deleting and then replacing old
versions of software.

The error is as follows:

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

This error is produced after running the following code ():

library(RJDBC)
drv <- JDBC("com.mysql.jdbc.Driver",
           "/etc/jdbc/mysql-connector-java-5.1.6-bin.jar",
           identifier.quote="`")

This code was modified from code at www.rforge.net/RJDBC to include
version 5.1.6 of the driver.  Version 3.1.14 gave the same error.  I
think that R is having trouble finding the class (driver) in the .jar
file even though I can see it using winzip.  I have limited knowledge
of R and Java, but use other programing languages for work.  Thank you
for your help.

=========
Environment:
=========

>From CRAN
-R 2.7.0

Installed in R using the command "install.packages("RJDBC",dep=TRUE)"
-RJDBC
-DBI
-rJava

>From MySQL.com
-mysql-connector-java-5.1.6-bin.jar
-MySQL 5.0.51b (win32)

>From Java.com
-Java 6 update 6

--
Daniel Montgomery
damontgomery at gmail.com



More information about the R-help mailing list