提交 c2509757 编写于 作者: D dingbo

docs: refine python and java connect tutorial

上级 acf996cd
......@@ -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).
......@@ -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
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册