[Rd] rJava and RJDBC

From: Joe W. Byers <ecjbosu_at_aol.com>
Date: Wed, 26 Sep 2007 21:03:57 -0500

I am desperate for help.

I am trying to get the RJDBC and rJava .5to work on both my windows xp and linux Redhat EL5 Server. On both I get a ava.lang.ClassNotFoundException when calling JDBC().

My example is
classPath='C:\\libraries\\mysql-connector-java-5.1.3-rc\\mysql-connector-java-5.1.3-rc-bin.jar' driverClass=c("com.mysql.jdbc.Driver")
drv <- JDBC(c("com.mysql.jdbc.Driver"),classPath,"`")

This returns a NULL value and a java exception.  > .jgetEx()
[1] "Java-Object{java.lang.ClassNotFoundException: com.mysql.jdbc.Driver}" my java version is
 > .jcall('java.lang.System','S','getProperty','java.version') [1] "1.6.0_02"

When I use java 1.5.0_11 jre I have the same problem but the .jgetEx() is
 > .jgetEx()
[1] "Java-Object{}

my class path is
 > .jclassPath()
[1] "C:\\PROGRA~1\\R\\library\\rJava\\java"

[2] "."


[4] "C:\\libraries\\xmlbeans-2.0.0-beta1\\lib\\xbean.jar"

[5] "C:\\libraries\\POI\\poi-2.5.1-final-20040804.jar"

[6] "C:\\libraries\\POI\\poi-contrib-2.5.1-final-20040804.jar"

[7] "C:\\libraries\\POI\\poi-scratchpad-2.5.1-final-20040804.jar"

[8] "C:\\Libraries\\PJM\\eDataFeed.jar"

[9] "C:\\Libraries\\PJM\\webserviceclient.jar"

[10] "C:\\Java\\Libraries\\QTJava.zip"

My java_Home is
 > .jcall('java.lang.System','S','getProperty','java.home') [1] "C:\\Java\\jre1.6.0_02"

I have tried breaking down the JDBC as
.jinit() or .jinit(classPath)
v<-.jcall("java/lang/ClassLoader","Ljava/lang/ClassLoader;", "getSystemClassLoader")
.jcall("java/lang/Class", "Ljava/lang/Class;",

             "forName", as.character(driverClass)[1], TRUE, v)   to no avail.

I have tried different versions of the mysql jar.

I do not know if my java version not compatible, my java settings are wrong, or I am just blind to the problem. This is the same for both my Windows XP and Redhat EL5 Server.

I really appreciate any and all assistance.

Thank you

R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Thu 27 Sep 2007 - 02:12:44 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 27 Sep 2007 - 14:41:38 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.