[R] RJDBC and rjava

Joe W. Byers ecjbosu at aol.com
Tue Sep 25 11:02:40 CEST 2007


Help is sincerely requested.

After further investigation, I found that if I run .jmethods and have 
the listing below.  I know that this driver works because I have a java 
program using that loads data scrapped from the web every night.

The call to JDBC in my previous email is trying to create the instance 
of the jdbc driver as my java code does.
ie.
static final String JDBC_DRIVER = "com.mysql.jdbc.Driver";
Class.forName(JDBC_DRIVER); // .newInstance() ;
conn = DriverManager.getConnection("jdbc:mysql://" + svr + ":3306/"
+ sqldb + "?user=XXXXXXXXX&jdbcCompliantTruncation=false");

Again, I appreciate any and all help.

Joe


.jmethods('com.mysql.jdbc.Driver')

  [1] "public java.lang.String 
com.mysql.jdbc.NonRegisteringDriver.host(java.util.Properties)" 

  [2] "public java.util.Properties 
com.mysql.jdbc.NonRegisteringDriver.parseURL(java.lang.String,java.util.Properties) 
throws java.sql.SQLException"
  [3] "public int 
com.mysql.jdbc.NonRegisteringDriver.port(java.util.Properties)" 

  [4] "public java.sql.Connection 
com.mysql.jdbc.NonRegisteringDriver.connect(java.lang.String,java.util.Properties) 
throws java.sql.SQLException"
  [5] "public boolean 
com.mysql.jdbc.NonRegisteringDriver.acceptsURL(java.lang.String) throws 
java.sql.SQLException"
  [6] "public int com.mysql.jdbc.NonRegisteringDriver.getMajorVersion()" 
 

  [7] "public int com.mysql.jdbc.NonRegisteringDriver.getMinorVersion()" 
 

  [8] "public java.sql.DriverPropertyInfo[] 
com.mysql.jdbc.NonRegisteringDriver.getPropertyInfo(java.lang.String,java.util.Properties) 
throws java.sql.SQLException"
  [9] "public boolean 
com.mysql.jdbc.NonRegisteringDriver.jdbcCompliant()" 

[10] "public java.lang.String 
com.mysql.jdbc.NonRegisteringDriver.database(java.util.Properties)" 

[11] "public java.lang.String 
com.mysql.jdbc.NonRegisteringDriver.property(java.lang.String,java.util.Properties)" 

[12] "public native int java.lang.Object.hashCode()" 
 

[13] "public final native java.lang.Class java.lang.Object.getClass()" 
 

[14] "public final native void java.lang.Object.wait(long) throws 
java.lang.InterruptedException" 

[15] "public final void java.lang.Object.wait(long,int) throws 
java.lang.InterruptedException" 

[16] "public final void java.lang.Object.wait() throws 
java.lang.InterruptedException" 

[17] "public boolean java.lang.Object.equals(java.lang.Object)" 
 

[18] "public java.lang.String java.lang.Object.toString()" 
 

[19] "public final native void java.lang.Object.notify()" 
 

[20] "public final native void java.lang.Object.notifyAll()"


Joe W. Byers wrote:
> I am having trouble getting RJDBC and rJava working.  rjava does not
> seem to be able to traverse my classpath that I define inside R.
> 
> My example is
> library(RJDBC)
> .jinit('C:\\Libraries\\mysql-connector-java-5.1.3-rc\\mysql-connector-java-5.1.3-rc-bin.jar')
> drv <- JDBC("com.mysql.jdbc.Driver",
> 'C:\\Libraries\\mysql-connector-java-5.1.3-rc\\mysql-connector-java-5.1.3-rc-bin.jar'
> , identifier.quote ="`")
> 
> 
> the call to JDBC and hence the call so jclassPath, cause the following error
> Error in JDBC("com.mysql.jdbc.Driver",
> "C:\\Libraries\\mysql-connector-java-5.1.3-rc\\mysql-connector-java-5.1.3-rc-bin.jar",
>  :
>         Cannot find JDBC driver class com.mysql.jdbc.Driver
> 
> Any help is greatly appreciated.
> 
> Thank you
> Joe
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list