From 314c749965d6f0a5baaf52b1f6f336065b64ab46 Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Sat, 5 Aug 2023 20:58:49 +0800 Subject: [PATCH] docs: supplement r language connnector note (#22340) * docs: add r language to connector * docs: add r lang english version in connector * docs: fix include path and note format * Update 60-r-lang.mdx minor changes * docs: supplement r language note --------- Co-authored-by: danielclow <106956386+danielclow@users.noreply.github.com> --- docs/en/14-reference/03-connector/60-r-lang.mdx | 5 +++-- docs/examples/R/connect_rest.r | 4 ++++ docs/zh/08-connector/43-r-lang.mdx | 5 +++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/docs/en/14-reference/03-connector/60-r-lang.mdx b/docs/en/14-reference/03-connector/60-r-lang.mdx index 852b2022a5..f1cbb89f7b 100644 --- a/docs/en/14-reference/03-connector/60-r-lang.mdx +++ b/docs/en/14-reference/03-connector/60-r-lang.mdx @@ -24,8 +24,9 @@ install.packages("RJDBC", repos='http://cran.us.r-project.org') ``` :::note -On Linux systems, installing the RJDBC package may require installing the necessary components for compilation. For example, on Ubuntu, you can execute the command ``apt install -y libbz2-dev libpcre2-dev libicu-dev`` to install the required components. -On Windows systems, you need to set the **JAVA_HOME** environment variable. +1. The default R language package version 4.2 which shipped with Ubuntu might lead unresponsive bug. Please install latest version of R language package from the [official website](https://www.r-project.org/). +2. On Linux systems, installing the RJDBC package may require installing the necessary components for compilation. For example, on Ubuntu, you can execute the command ``apt install -y libbz2-dev libpcre2-dev libicu-dev`` to install the required components. +3. On Windows systems, you need to set the **JAVA_HOME** environment variable. ::: 3. Download the TDengine JDBC driver: Visit the Maven website and download the TDengine JDBC driver (taos-jdbcdriver-X.X.X-dist.jar) to your local machine. diff --git a/docs/examples/R/connect_rest.r b/docs/examples/R/connect_rest.r index bc5da3c15a..a5221d2c3b 100644 --- a/docs/examples/R/connect_rest.r +++ b/docs/examples/R/connect_rest.r @@ -12,5 +12,9 @@ driver_path = args[1] # path to jdbc-driver for example: "/root/taos-jdbcdriver- driver = JDBC("com.taosdata.jdbc.rs.RestfulDriver", driver_path) conn = dbConnect(driver, "jdbc:TAOS-RS://localhost:6041?user=root&password=taosdata") dbGetQuery(conn, "SELECT server_version()") +dbSendUpdate(conn, "create database if not exists rtest") +dbSendUpdate(conn, "create table if not exists rtest.test (ts timestamp, current float, voltage int, devname varchar(20))") +dbSendUpdate(conn, "insert into rtest.test values (now, 1.2, 220, 'test')") +dbGetQuery(conn, "select * from rtest.test") dbDisconnect(conn) # ANCHOR_END: demo diff --git a/docs/zh/08-connector/43-r-lang.mdx b/docs/zh/08-connector/43-r-lang.mdx index 3a4ed39748..a181f68aba 100644 --- a/docs/zh/08-connector/43-r-lang.mdx +++ b/docs/zh/08-connector/43-r-lang.mdx @@ -24,8 +24,9 @@ install.packages("RJDBC", repos='http://cran.us.r-project.org') ``` :::note -在 Linux 上安装 RJDBC 包可能需要安装编译需要的组件,以 Ubuntu 为例执行 `apt install -y libbz2-dev libpcre2-dev libicu-dev` 命令安装。 -在 Windows 系统上需要设置 JAVA_HOME 环境变量。 +1. Ubuntu 系统自带的 R 语言软件版本 4.2 在调用 RJDBC 库会产生无响应 bug,请安装 R 语言[官网](https://www.r-project.org/)的安装包。 +2. 在 Linux 上安装 RJDBC 包可能需要安装编译需要的组件,以 Ubuntu 为例执行 `apt install -y libbz2-dev libpcre2-dev libicu-dev` 命令安装。 +3. 在 Windows 系统上需要设置 JAVA_HOME 环境变量。 ::: 3. 下载 TDengine JDBC 驱动程序:访问 maven.org 网站,下载 TDengine JDBC 驱动程序(taos-jdbcdriver-X.X.X-dist.jar)。