I am having trouble loading Oracle JDBC driver into RJDBC.
Basically, i installed RJDBC and used it to connect to MySql. However, when i try to load JDBC Oracle driver, it gives me an error message
> drv<-JDBC("oracle.jdbc.driver.OracleDriver", "/pathToDriver/ojdbc6.jar")
Error in .jfindClass(as.character(driverClass))
java.lang.UnsupportedClassVersionError: Bad version number in .class file
Few relevant facts
1. I use this JDBC driver elsewhere, in DBvizualiser, it connects fine
2. I run R and Java on 64 bit Red Hat Linux.
3. I run same version of JRE in DBvizualiser that works with the driver as the version that doesn't work
What could it be? Would really appreciate someone familiar with RJDBC commenting
More details on versions:
Java version is
java version "1.6.0_10"
Java(TM) SE Runtime Environment (build 1.6.0_10-b33)
Java HotSpot(TM) 64-Bit Server VM (build 11.0-b15, mixed mode)
R version 2.10.0 (2009-10-26)
Linux 2.6.18-164.19.1.el5 #1 SMP Mon May 24 17:03:22 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
I asked my local java export and his reply was that the driver was compiled with the later version of java that i need to install. I did install it in parallel to existing java and changed JAVA_HOME variable to point to new java directory. I also pre-pended PATH with path to java. Still, when i try to load the driver
Hmm, for the sake of anyone who steps on the same mine. Basically, this class error always say that you need to install latest java. It's not enough to get new jre -- you need to get full latest jdk as well. After that you need to do R reconfiguration, which is done by
R CMD javareconf
Then you need to reinstall rJava package. I don't know why exactly these are the necessary steps but fact is that they are. Wish someone told me. In any case, this thread proved to be an informative conversation between two or three sophisticated users :).