From c2509757ad6ed8780dc4c19c58ceaa16de659081 Mon Sep 17 00:00:00 2001 From: dingbo Date: Tue, 7 Jun 2022 22:08:38 +0800 Subject: [PATCH] docs: refine python and java connect tutorial --- docs-en/05-develop/01-connect/01-python.md | 4 +++- docs-en/05-develop/01-connect/02-java.md | 5 +++-- docs-en/09-connector/python.md | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/docs-en/05-develop/01-connect/01-python.md b/docs-en/05-develop/01-connect/01-python.md index 0dfae33c23..c137df32f6 100644 --- a/docs-en/05-develop/01-connect/01-python.md +++ b/docs-en/05-develop/01-connect/01-python.md @@ -31,6 +31,8 @@ You should replace above placeholders as real values. To obtain these values, pl ## Connect +Copy code bellow to your editor and run it with `python3` command. + ```python import taosrest import os @@ -41,4 +43,4 @@ token = os.environ["TDENGINE_CLOUD_TOKEN"] conn = taosrest.connect(url=url, token=token) ``` -The client connection is then established. For how to write data and query data, please refer to [basic usage](../../connector/python#basic-usage). +The client connection is then established. For how to write data and query data, please refer to [sample-program](https://docs.tdengine.com/cloud/connector/python/#sample-program). diff --git a/docs-en/05-develop/01-connect/02-java.md b/docs-en/05-develop/01-connect/02-java.md index b8c3bdeab7..2569084373 100644 --- a/docs-en/05-develop/01-connect/02-java.md +++ b/docs-en/05-develop/01-connect/02-java.md @@ -42,6 +42,8 @@ You should replace above placeholders as real values. To obtain these values, pl ## Connect +Code bellow get variable URL and token from environment first and then create a `RestfulConnection` object, witch is a standard JDBC Connection object. + ```java import com.taosdata.jdbc.rs.RestfulConnection; import java.sql.Connection; @@ -51,10 +53,9 @@ public class ConnectCloudExample { public static void main(String[] args) throws Exception { String url = System.getenv("TDENGINE_CLOUD_URL"); String token = System.getenv("TDENGINE_CLOUD_TOKEN"); - // create a standard JDBC connection. Connection conn = new RestfulConnection(url, token); } } ``` -The client connection is then established. \ No newline at end of file +The client connection is then established. For how to write data and query data using the connection, please refer to [usage-examples](https://docs.tdengine.com/reference/connector/java#usage-examples). \ No newline at end of file diff --git a/docs-en/09-connector/python.md b/docs-en/09-connector/python.md index 16e8e1d85d..c787b18c94 100644 --- a/docs-en/09-connector/python.md +++ b/docs-en/09-connector/python.md @@ -71,7 +71,7 @@ For a more detailed description of the `sql()` method, please refer to [RestClie | ----------------- | ----------------------------------------- | ------------ | | 2.3.3 | support connect to TDengine Cloud Service | 2022-06-06 | -[**Release Notes**] (https://github.com/taosdata/taos-connector-python/releases) +[**Release Notes**](https://github.com/taosdata/taos-connector-python/releases) ## API Reference -- GitLab