rjdbc

Postgres DB can't connect to R with RJDBC

寵の児 提交于 2019-12-21 17:53:18
问题 I've been trying to query data from a PostgreSQL DB via R. I've tried skinning the cat with a few different packages ( RODBC, RJDBC, DBI, RPostgres , etc), but I seem to keep getting driver errors. Oddly, I never have trouble using the same drivers/URL's and settings to connect to Postgres from SQLWorkbench/J. I've tried using postgresql-9.2-1002.jdbc4.jar and postgresql-9.3-1100.jdbc41.jar , as well as the generic "PostgreSQL" driver in R. The two jar files are the (i) the driver I use all

Error loading csv data into Hive table

☆樱花仙子☆ 提交于 2019-12-19 00:12:13
问题 i have a csv file in hadoop and i have a Hive table ,now i want to laoad that csv file into this Hive table i have used load LOAD DATA local 'path/to/csv/file' overwrite INTO TABLE tablename; ended up with this error : Error in .verify.JDBC.result(r, "Unable to retrieve JDBC result set for ", : Unable to retrieve JDBC result set for LOAD DATA local 'path/to/csv/file' overwrite INTO TABLE tablename (Error while processing statement: FAILED: ParseException line 1:16 missing INPATH at ''path/tp

Writing and Updating DB2 tables with r

自作多情 提交于 2019-12-14 04:18:19
问题 I can't figure out how to update an existing DB2 database in R or update a single value in it. I can't find much information on this topic online other than very general information, but no specific examples. library(RJDBC) teachersalaries=data.frame(name=c("bob"), earnings=c(100)) dbSendUpdate(conn, "UPDATE test1 salary",teachersalaries[1,2]) AND teachersalaries=data.frame(name=c("bob",'sally'), earnings=c(100,200)) dbSendUpdate(conn, "INSERT INTO test1 salary", teachersalaries[which

RJDBC wrongly reading bigintegers from database table

两盒软妹~` 提交于 2019-12-14 04:03:16
问题 I am retrieving a column containing big integers from a data base into R (using RJDBCs dbGetQuery method). For a test case, one can consider the following numbers 1000522010609612 1000522010609613 1000522010609614 1000522010609615 1000522010609616 1000522010609617 **971000522010609612 1501000522010819466 971000522010943717 1501000522010733490** R seems to be reading the contents wrongly. The way in which it is available to me in R (after I read from the database using RJDBC) is:

Deleting oracle table using RJDBC

江枫思渺然 提交于 2019-12-14 03:17:38
问题 Is there a way to delete (truncate) a table in R using oracle function? I am using JDBC to connect to oracle; I would like truncate the contents and then load new data into the table. For instance: select employee_info into variable_name; This will execute the function and load NULL (if successful) or error_message into variable_name . Next step…check contents of variable_name . If NULL , proceed with insert. If variable_name IS NULL THEN INSERT INTO 回答1: Yes. You can execute in Oracle:

rJava fails while invoking RJDBC library from OpenCPU API

冷暖自知 提交于 2019-12-11 12:26:44
问题 Goal : To use RJDBC with OpenCPU AJAX Post call. Use case : I need to connect with Apache phoenix database and get some data. And on that data I am supposed to do analytics. So to connect with Phoenix i am using rjdbc(phoenix doesn't support any other option to connect). Environment : public.opencpu.org Here is what I am trying: html <textarea> library(RJDBC) .. do some data fetching and then r statistics </textarea> <br /> <button id="submitbutton" >Execute</button> <br /> <br /> <div id=

RH2: Connect to H2 Database in R

删除回忆录丶 提交于 2019-12-11 09:38:01
问题 I tried to connect with RH2 to a H2 (1.4.181) Database. I've tried different things, like reinstalling R, and fixing potential problems with rJava on Ubuntu. However following error does not disappear: > library("RH2") Loading required package: chron Loading required package: RJDBC Loading required package: DBI Loading required package: rJava > con <- dbConnect(H2(driverClass="org.h2.Driver", jars = "~/h2-1.4.181.jar"), "jdbc:h2:~/test", "sa", "") Error in is(object, Cl): error in evaluating

connect to Remote Hive Server from R using RJDBC/RHive

久未见 提交于 2019-12-09 23:18:06
问题 I'm using RJDBC 0.2-5 to connect to Hive in Rstudio. My server has hadoop-2.4.1 and hive-0.14. I follow the below mention steps to connect to Hive. library(DBI) library(rJava) library(RJDBC) .jinit(parameters="-DrJava.debug=true") drv <- JDBC("org.apache.hadoop.hive.jdbc.HiveDriver", c("/home/packages/hive/New folder3/commons-logging-1.1.3.jar", "/home/packages/hive/New folder3/hive-jdbc-0.14.0.jar", "/home/packages/hive/New folder3/hive-metastore-0.14.0.jar", "/home/packages/hive/New folder3

Writing a data frame to a Teradata table using RJDBC

不羁的心 提交于 2019-12-08 21:55:49
问题 After establishing a connection as explained here, I tried to write a very simple data frame ( trythis , shown below) to a table called gh_test_20141105 in a database called p_cia_t . First, I tried > conn <- getTdConnection(vdm='vivaldi') > dbWriteTable(conn=conn,name=tbl,value=trythis) Error in .verify.JDBC.result(s, "Unable to execute JDBC prepared statement ", : Unable to execute JDBC prepared statement INSERT INTO p_cia_t.gh_test_20141005 VALUES(?,?,?,?) ([Teradata Database] [TeraJDBC 14

connect to Remote Hive Server from R using RJDBC/RHive

筅森魡賤 提交于 2019-12-04 18:56:10
I'm using RJDBC 0.2-5 to connect to Hive in Rstudio. My server has hadoop-2.4.1 and hive-0.14. I follow the below mention steps to connect to Hive. library(DBI) library(rJava) library(RJDBC) .jinit(parameters="-DrJava.debug=true") drv <- JDBC("org.apache.hadoop.hive.jdbc.HiveDriver", c("/home/packages/hive/New folder3/commons-logging-1.1.3.jar", "/home/packages/hive/New folder3/hive-jdbc-0.14.0.jar", "/home/packages/hive/New folder3/hive-metastore-0.14.0.jar", "/home/packages/hive/New folder3/hive-service-0.14.0.jar", "/home/packages/hive/New folder3/libfb303-0.9.0.jar", "/home/packages/hive