From simon.urbanek at r-project.org  Thu Sep 27 14:31:54 2007
From: simon.urbanek at r-project.org (Simon Urbanek)
Date: Thu, 27 Sep 2007 08:31:54 -0400
Subject: [Rd] rJava and RJDBC
In-Reply-To: <fdf330$e7b$1@sea.gmane.org>
References: <fdf330$e7b$1@sea.gmane.org>
Message-ID: <2D6F08DC-1015-4210-8764-95B59BB2B3EF@r-project.org>

Joe,

which version of R and RJDBC are you using? The behavior you describe  
should have been fixed in RJDBC 0.1-4. Please try the latest version  
from rforge
install.packages("RJDBC",,"http://rforge.net/")
and please let me know if that solves your problem.

Cheers,
Simon


On Sep 26, 2007, at 10:03 PM, Joe W. Byers wrote:

> 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
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>
>



[Rd] rJava and RJDBC
Simon Urbanek