rjdbc

dbHasCompleted always returns TRUE

生来就可爱ヽ(ⅴ<●) 提交于 2020-06-13 06:19:29
问题 I'm using R to do a statistical analysis on a SQL Server 2008 R2 database. My database client (aka driver) is JDBC and thereby I'm using RJDBC package. My query is pretty simple and I'm sure that query would return a lot of rows (about 2 million rows). SELECT * FROM [maindb].[dbo].[users] My R script is as follows. library(RJDBC); javaPackageName <- "com.microsoft.sqlserver.jdbc.SQLServerDriver"; clientJarFile <- "/home/abforce/mystuff/sqljdbc_3.0/enu/sqljdbc4.jar"; driver <- JDBC

dBWriteTable cannot write NULLs into SQL Server table

岁酱吖の 提交于 2020-01-23 12:52:55
问题 ISSUE Cannot insert NA values from a data.frame to a DB Table STEPS Read table from SQL server into R data.frame . Table is decimal with some NULL . data.frame is numeric with some NA . dBWriteTable throws the following error Error in .local(conn, statement, ...) : execute JDBC update query failed in dbSendUpdate (The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. Parameter 57 (""): The supplied value is not a valid instance of data type float.

Connecting to MS SQL Server from R on Mac/Linux

血红的双手。 提交于 2020-01-10 14:12:48
问题 I'm trying to connect to a Microsoft SQL Server from R on Mac/Linux, and I have problems with RJDBC. When I've downloaded both Microsoft's driver and JTDS, but none of the following lines work: library(RJDBC) drv <- JDBC("com.microsoft.sqlserver.jdbc.SQLServerDriver", "/Users/victor/Downloads/sqljdbc_3.0/enu/sqljdbc4.jar") drv1 <- JDBC('net.sourceforge.jtds.jdbc.Driver', "/Users/victor/Downloads/jtds-1/jtds-1.3.0.jar") Each one returns the following error message: Error in .jfindClass(as

JDBC Connection to Hive version 0.14.0 and from R via RDBC package

匆匆过客 提交于 2020-01-06 15:52:12
问题 I am having hiveserver running on a machine1 Following code I have used for JDBC connection hive_jars <- list.files("/home/jar/hive_jdbc_jar/", pattern = "[.]jar", full.names=FALSE, recursive=TRUE) lib_dir <- "/home/jar/hive_jdbc_jar/" hive_class_path <- sprintf( '%s/%s', lib_dir, hive_jars ) .jinit(classpath=hive_class_path, parameters="-DrJava.debug=true") hostname <- "10.140.224.64" port <- "10000" drv <- JDBC( 'org.apache.hadoop.hive.jdbc.HiveDriver', classPath= hive_class_path, "`" )

JDBC Connection to Hive version 0.14.0 and from R via RDBC package

帅比萌擦擦* 提交于 2020-01-06 15:51:59
问题 I am having hiveserver running on a machine1 Following code I have used for JDBC connection hive_jars <- list.files("/home/jar/hive_jdbc_jar/", pattern = "[.]jar", full.names=FALSE, recursive=TRUE) lib_dir <- "/home/jar/hive_jdbc_jar/" hive_class_path <- sprintf( '%s/%s', lib_dir, hive_jars ) .jinit(classpath=hive_class_path, parameters="-DrJava.debug=true") hostname <- "10.140.224.64" port <- "10000" drv <- JDBC( 'org.apache.hadoop.hive.jdbc.HiveDriver', classPath= hive_class_path, "`" )

R and cassandra connection error

£可爱£侵袭症+ 提交于 2020-01-01 19:43:14
问题 library(RJDBC) cassdrv <- JDBC("org.apache.cassandra.cql.jdbc.CassandraDriver", list.files("/home/beyhan/Downloads/jars/",pattern="jar$",full.names=T)) casscon <- dbConnect(cassdrv, "jdbc:cassandra://localhost:9042") Output > cassdrv <- JDBC("org.apache.cassandra.cql.jdbc.CassandraDriver", + list.files("/home/beyhan/Downloads/jars/",pattern="jar$",full.names=T)) > casscon <- dbConnect(cassdrv, "jdbc:cassandra://localhost:9042") Error in .jcall(drv@jdrv, "Ljava/sql/Connection;", "connect", as

Unable to connect cassandra through R

百般思念 提交于 2020-01-01 06:58:06
问题 I am trying to follow an example given on "http://www.datastax.com/dev/blog/big-analytics-with-r-cassandra-and-hive" to connect R with Cassandra. Following is my code: library(RJDBC) #Load in the Cassandra-JDBC diver cassdrv <- JDBC("org.apache.cassandra.cql.jdbc.CassandraDriver", list.files("D:/cassandra/lib",pattern="jar$",full.names=T)) #Connect to Cassandra node and Keyspace casscon <- dbConnect(cassdrv, "jdbc:cassandra://127.0.0.1:9042/demodb") When I run above code in R, I get following

Connect to ORACLE via R, using the info in sql developer

烈酒焚心 提交于 2019-12-24 19:54:14
问题 I am working on a machine without admin rights. I use sql developer to connect to an internal database. I would like to connect via R also. Is there any way I can do this, without admin rights? Some solutions require me to set up a systemDNS - which I can not do. Other requires me to install jvm.dll My environment: Windows7, sqldeveloper, connection method is via TNS file. 回答1: Connecting to SQL Developer via R is far more difficult than other databases I've encountered. It's important that

create / drop view / table using rjdbc

£可爱£侵袭症+ 提交于 2019-12-24 09:49:12
问题 I am trying to automate an analytic process using rjdbc. I am looking for a way to create and drop a view from within R , using the rjdbc package. 回答1: found it dbSendUpdate(conn, "drop view VIEW_NAME") dbSendUpdate allows you to send queries without retrieving data, so it is possible to use this method to create, drop, and manipulate views and tables 回答2: or you can use dplyr::db_drop_table to drop the table 来源: https://stackoverflow.com/questions/39366295/create-drop-view-table-using-rjdbc