From ecjbosu at aol.com  Thu Sep 27 04:03:57 2007
From: ecjbosu at aol.com (Joe W. Byers)
Date: Wed, 26 Sep 2007 21:03:57 -0500
Subject: [Rd] rJava and RJDBC
Message-ID: <fdf330$e7b$1@sea.gmane.org>

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
require(RJDBC)
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"
jre


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] "." 

  [3] 
"C:\\libraries\\mysql-connector-java-5.1.3-rc\\mysql-connector-java-5.1.3-rc-bin.jar"
  [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
Joe



[Rd] rJava and RJDBC
Joe W. Byers