docs: fix some links and format errors
This commit is contained in:
parent
9ec3c78621
commit
a395b3e91a
|
@ -48,7 +48,7 @@ Please refer to [version support list](/reference/connector#version-support)
|
||||||
|
|
||||||
* Install the [.NET SDK](https://dotnet.microsoft.com/download)
|
* Install the [.NET SDK](https://dotnet.microsoft.com/download)
|
||||||
* [Nuget Client](https://docs.microsoft.com/en-us/nuget/install-nuget-client-tools) (optional installation)
|
* [Nuget Client](https://docs.microsoft.com/en-us/nuget/install-nuget-client-tools) (optional installation)
|
||||||
* Install TDengine client driver, please refer to [Install client driver](/reference/connector#Install client driver) for details
|
* Install TDengine client driver, please refer to [Install client driver](/reference/connector/#install-client-driver) for details
|
||||||
|
|
||||||
### Install via dotnet CLI
|
### Install via dotnet CLI
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ Please refer to [version support list](/reference/connector#version-support)
|
||||||
|
|
||||||
You can reference the `TDengine.Connector` published in Nuget to the current project via the `dotnet` command under the path of the existing .NET project.
|
You can reference the `TDengine.Connector` published in Nuget to the current project via the `dotnet` command under the path of the existing .NET project.
|
||||||
|
|
||||||
``` bash
|
```
|
||||||
dotnet add package TDengine.Connector
|
dotnet add package TDengine.Connector
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ dotnet add package TDengine.Connector
|
||||||
|
|
||||||
You can download TDengine's source code and directly reference the latest version of the TDengine.Connector library
|
You can download TDengine's source code and directly reference the latest version of the TDengine.Connector library
|
||||||
|
|
||||||
```bash
|
```
|
||||||
git clone https://github.com/taosdata/TDengine.git
|
git clone https://github.com/taosdata/TDengine.git
|
||||||
cd TDengine/src/connector/C#/src/
|
cd TDengine/src/connector/C#/src/
|
||||||
cp -r TDengineDriver/ myProject
|
cp -r TDengineDriver/ myProject
|
||||||
|
@ -79,7 +79,7 @@ dotnet add TDengineDriver/TDengineDriver.csproj
|
||||||
|
|
||||||
## Create a connection
|
## Create a connection
|
||||||
|
|
||||||
``` C#
|
```csharp
|
||||||
using TDengineDriver;
|
using TDengineDriver;
|
||||||
|
|
||||||
namespace TDengineExample
|
namespace TDengineExample
|
||||||
|
|
|
@ -69,7 +69,7 @@ Before using Java Connector to connect to the database, the following conditions
|
||||||
### Install the connectors
|
### Install the connectors
|
||||||
|
|
||||||
<Tabs defaultValue="maven">
|
<Tabs defaultValue="maven">
|
||||||
<TabItem value="maven" label="install via Maven">
|
<TabItem value="maven" label="Install via Maven">
|
||||||
|
|
||||||
- [sonatype](https://search.maven.org/artifact/com.taosdata.jdbc/taos-jdbcdriver)
|
- [sonatype](https://search.maven.org/artifact/com.taosdata.jdbc/taos-jdbcdriver)
|
||||||
- [mvnrepository](https://mvnrepository.com/artifact/com.taosdata.jdbc/taos-jdbcdriver)
|
- [mvnrepository](https://mvnrepository.com/artifact/com.taosdata.jdbc/taos-jdbcdriver)
|
||||||
|
@ -77,7 +77,7 @@ Before using Java Connector to connect to the database, the following conditions
|
||||||
|
|
||||||
Add following dependency in the `pom.xml` file of your Maven project:
|
Add following dependency in the `pom.xml` file of your Maven project:
|
||||||
|
|
||||||
```xml-dtd
|
```xml
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.taosdata.jdbc</groupId>
|
<groupId>com.taosdata.jdbc</groupId>
|
||||||
<artifactId>taos-jdbcdriver</artifactId>
|
<artifactId>taos-jdbcdriver</artifactId>
|
||||||
|
@ -90,7 +90,7 @@ Add following dependency in the `pom.xml` file of your Maven project:
|
||||||
|
|
||||||
You can build Java connector from source code after cloning the TDengine project:
|
You can build Java connector from source code after cloning the TDengine project:
|
||||||
|
|
||||||
```shell
|
```
|
||||||
git clone https://github.com/taosdata/taos-connector-jdbc.git
|
git clone https://github.com/taosdata/taos-connector-jdbc.git
|
||||||
cd taos-connector-jdbc
|
cd taos-connector-jdbc
|
||||||
mvn clean install -Dmaven.test.skip=true
|
mvn clean install -Dmaven.test.skip=true
|
||||||
|
@ -140,8 +140,8 @@ When you use a JDBC native connection to connect to a TDengine cluster, you can
|
||||||
|
|
||||||
1. Do not specify hostname and port in Java applications.
|
1. Do not specify hostname and port in Java applications.
|
||||||
|
|
||||||
```java
|
```java
|
||||||
public Connection getConn() throws Exception{
|
public Connection getConn() throws Exception{
|
||||||
Class.forName("com.taosdata.jdbc.TSDBDriver");
|
Class.forName("com.taosdata.jdbc.TSDBDriver");
|
||||||
String jdbcUrl = "jdbc:TAOS://:/test?user=root&password=taosdata";
|
String jdbcUrl = "jdbc:TAOS://:/test?user=root&password=taosdata";
|
||||||
Properties connProps = new Properties();
|
Properties connProps = new Properties();
|
||||||
|
@ -150,30 +150,33 @@ public Connection getConn() throws Exception{
|
||||||
connProps.setProperty(TSDBDriver.PROPERTY_KEY_TIME_ZONE, "UTC-8");
|
connProps.setProperty(TSDBDriver.PROPERTY_KEY_TIME_ZONE, "UTC-8");
|
||||||
Connection conn = DriverManager.getConnection(jdbcUrl, connProps);
|
Connection conn = DriverManager.getConnection(jdbcUrl, connProps);
|
||||||
return conn;
|
return conn;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
2. specify the firstEp and the secondEp in the configuration file taos.cfg
|
2. specify the firstEp and the secondEp in the configuration file taos.cfg
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
# first fully qualified domain name (FQDN) for TDengine system
|
# first fully qualified domain name (FQDN) for TDengine system
|
||||||
firstEp cluster_node1:6030
|
firstEp cluster_node1:6030
|
||||||
|
|
||||||
# second fully qualified domain name (FQDN) for TDengine system, for cluster only
|
# second fully qualified domain name (FQDN) for TDengine system, for cluster only
|
||||||
secondEp cluster_node2:6030
|
secondEp cluster_node2:6030
|
||||||
|
|
||||||
# default system charset
|
# default system charset
|
||||||
# charset UTF-8
|
# charset UTF-8
|
||||||
|
|
||||||
# system locale
|
# system locale
|
||||||
# locale en_US.UTF-8
|
# locale en_US.UTF-8
|
||||||
```
|
```
|
||||||
|
|
||||||
In the above example, JDBC uses the client's configuration file to establish a connection to a hostname `cluster_node1`, port 6030, and a database named `test`. When the firstEp node in the cluster fails, JDBC attempts to connect to the cluster using secondEp.
|
In the above example, JDBC uses the client's configuration file to establish a connection to a hostname `cluster_node1`, port 6030, and a database named `test`. When the firstEp node in the cluster fails, JDBC attempts to connect to the cluster using secondEp.
|
||||||
|
|
||||||
In TDengine, as long as one node in firstEp and secondEp is valid, the connection to the cluster can be established normally.
|
In TDengine, as long as one node in firstEp and secondEp is valid, the connection to the cluster can be established normally.
|
||||||
|
|
||||||
> **Note**: The configuration file here refers to the configuration file on the machine where the application that calls the JDBC Connector is located, the default path is `/etc/taos/taos.cfg` on Linux, and the default path is `C://TDengine/cfg/taos.cfg` on Windows.
|
:::note
|
||||||
|
The configuration file here refers to the configuration file on the machine where the application that calls the JDBC Connector is located, the default path is `/etc/taos/taos.cfg` on Linux, and the default path is `C://TDengine/cfg/taos.cfg` on Windows.
|
||||||
|
|
||||||
|
:::
|
||||||
|
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem value="rest" label="REST connection">
|
<TabItem value="rest" label="REST connection">
|
||||||
|
|
Loading…
Reference in New Issue