Unable to connect cassandra through R

不羁岁月 提交于 2019-12-03 19:04:38

Finally I was able to connect to cassandra through R. I followed the following steps:

  1. I updated my java 7 and R to the latest version.
  2. Then, I reinstalled RJDBC, rJava, DBI
  3. Then, I used the following code, and successfully got connected:

    library(RJDBC)
    
    drv <- JDBC("org.apache.cassandra.cql.jdbc.CassandraDriver", list.files("D:/cassandra/lib/",pattern="jar$",full.names=T))
    
    .jaddClassPath("D:/mysql-connector-java-3.1.14/cassandra-clientutil-1.0.2.jar")
    
    conn <- dbConnect(drv, "jdbc:cassandra://127.0.0.1:9160/demodb")
    
    res <- dbGetQuery(conn, "select * from emp")
    
    
    
    # print values
    res
    
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!