You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/UserGuide/Master/Table/API/Programming-JDBC.md
+7-6Lines changed: 7 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,19 +18,20 @@
18
18
under the License.
19
19
20
20
-->
21
+
# JDBC
21
22
22
23
The IoTDB JDBC provides a standardized way to interact with the IoTDB database, allowing users to execute SQL statements from Java programs for managing databases and time-series data. It supports operations such as connecting to the database, creating, querying, updating, and deleting data, as well as batch insertion and querying of time-series data.
23
24
24
25
**Note:** The current JDBC implementation is designed primarily for integration with third-party tools. High-performance writing **may not be achieved** when using JDBC for insert operations. For Java applications, it is recommended to use the **JAVA Native API** for optimal performance.
25
26
26
-
## Prerequisites
27
+
## 1. Prerequisites
27
28
28
-
### **Environment Requirements**
29
+
### 1.1 **Environment Requirements**
29
30
30
31
-**JDK:** Version 1.8 or higher
31
32
-**Maven:** Version 3.6 or higher
32
33
33
-
### **Adding Maven Dependencies**
34
+
### 1.2 **Adding Maven Dependencies**
34
35
35
36
Add the following dependency to your Maven `pom.xml` file:
36
37
@@ -44,13 +45,13 @@ Add the following dependency to your Maven `pom.xml` file:
44
45
</dependencies>
45
46
```
46
47
47
-
## Read and Write Operations
48
+
## 2. Read and Write Operations
48
49
49
50
**Write Operations:** Perform database operations such as inserting data, creating databases, and creating time-series using the `execute` method.
50
51
51
52
**Read Operations:** Execute queries using the `executeQuery` method and retrieve results via the `ResultSet` object.
@@ -63,7 +64,7 @@ Add the following dependency to your Maven `pom.xml` file:
63
64
| ResultSet.next() | Moves to the next row in the result set | None |`boolean`: Whether the move was successful |
64
65
| ResultSet.getString(int columnIndex) | Retrieves the string value of a specified column |`columnIndex`: Column index (starting from 1) |`String`: Column value |
65
66
66
-
## Sample Code
67
+
## 3. Sample Code
67
68
68
69
**Note:** When using the Table Model, you must specify the `sql_dialect` parameter as `table` in the URL. Example:
Copy file name to clipboardExpand all lines: src/UserGuide/Master/Table/API/Programming-Java-Native-API.md
+10-9Lines changed: 10 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,17 +18,18 @@
18
18
under the License.
19
19
20
20
-->
21
+
# Java Native API
21
22
22
23
IoTDB provides a Java native client driver and a session pool management mechanism. These tools enable developers to interact with IoTDB using object-oriented APIs, allowing time-series objects to be directly assembled and inserted into the database without constructing SQL statements. It is recommended to use the `ITableSessionPool` for multi-threaded database operations to maximize efficiency.
23
24
24
-
## Prerequisites
25
+
## 1. Prerequisites
25
26
26
-
### Environment Requirements
27
+
### 1.1 Environment Requirements
27
28
28
29
-**JDK**: Version 1.8 or higher
29
30
-**Maven**: Version 3.6 or higher
30
31
31
-
### Adding Maven Dependencies
32
+
### 1.2 Adding Maven Dependencies
32
33
33
34
```XML
34
35
<dependencies>
@@ -40,9 +41,9 @@ IoTDB provides a Java native client driver and a session pool management mechani
40
41
</dependencies>
41
42
```
42
43
43
-
## Read and Write Operations
44
+
## 2. Read and Write Operations
44
45
45
-
### ITableSession Interface
46
+
### 2.1 ITableSession Interface
46
47
47
48
The `ITableSession` interface defines basic operations for interacting with IoTDB, including data insertion, query execution, and session closure. Note that this interface is **not thread-safe**.
48
49
@@ -124,7 +125,7 @@ public interface ITableSession extends AutoCloseable {
124
125
}
125
126
```
126
127
127
-
### TableSessionBuilder Class
128
+
### 2.2 TableSessionBuilder Class
128
129
129
130
The `TableSessionBuilder` class is a builder for configuring and creating instances of the `ITableSession` interface. It allows developers to set connection parameters, query parameters, and security features.
130
131
@@ -336,9 +337,9 @@ public class TableSessionBuilder {
336
337
}
337
338
```
338
339
339
-
## Session Pool
340
+
## 3. Session Pool
340
341
341
-
### ITableSessionPool Interface
342
+
### 3.1 ITableSessionPool Interface
342
343
343
344
The `ITableSessionPool` interface manages a pool of `ITableSession` instances, enabling efficient reuse of connections and proper cleanup of resources.
344
345
@@ -378,7 +379,7 @@ public interface ITableSessionPool {
378
379
}
379
380
```
380
381
381
-
### TableSessionPoolBuilder Class
382
+
### 3.2 ableSessionPoolBuilder Class
382
383
383
384
The `TableSessionPoolBuilder` class is a builder for configuring and creating `ITableSessionPool` instances, supporting options like connection settings and pooling behavior.
Copy file name to clipboardExpand all lines: src/UserGuide/Master/Table/API/Programming-Python-Native-API.md
+9-8Lines changed: 9 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,20 +18,21 @@
18
18
under the License.
19
19
20
20
-->
21
+
# Python Native API
21
22
22
23
IoTDB provides a Python native client driver and a session pool management mechanism. These tools allow developers to interact with IoTDB in a programmatic and efficient manner. Using the Python API, developers can encapsulate time-series data into objects (e.g., `Tablet`, `NumpyTablet`) and insert them into the database directly, without the need to manually construct SQL statements. For multi-threaded operations, the `TableSessionPool` is recommended to optimize resource utilization and enhance performance.
23
24
24
-
## Prerequisites
25
+
## 1. Prerequisites
25
26
26
27
To use the IoTDB Python API, install the required package using pip:
27
28
28
29
```Java
29
30
pip3 install apache-iotdb
30
31
```
31
32
32
-
## Read and Write Operations
33
+
## 2. Read and Write Operations
33
34
34
-
### TableSession
35
+
### 2.1 TableSession
35
36
36
37
`TableSession` is a core class in IoTDB, enabling users to interact with the IoTDB database. It provides methods to execute SQL statements, insert data, and manage database sessions.
37
38
@@ -101,7 +102,7 @@ def close(self):
101
102
pass
102
103
```
103
104
104
-
### TableSessionConfig
105
+
### 2.2 TableSessionConfig
105
106
106
107
`TableSessionConfig` is a configuration class that sets parameters for creating a `TableSession` instance, defining essential settings for connecting to the IoTDB database.
107
108
@@ -159,9 +160,9 @@ class TableSessionConfig(object):
159
160
160
161
**Note:** After using a `TableSession`, make sure to call the `close` method to release resources.
161
162
162
-
## Session Pool
163
+
## 3. Session Pool
163
164
164
-
### TableSessionPool
165
+
### 3.1 TableSessionPool
165
166
166
167
`TableSessionPool` is a session pool management class designed for creating and managing `TableSession` instances. It provides functionality to retrieve sessions from the pool and close the pool when it is no longer needed.
167
168
@@ -200,7 +201,7 @@ def close(self):
200
201
"""
201
202
```
202
203
203
-
### TableSessionPoolConfig
204
+
### 3.2 TableSessionPoolConfig
204
205
205
206
`TableSessionPoolConfig` is a configuration class used to define parameters for initializing and managing a `TableSessionPool` instance. It specifies the settings needed for efficient session pool management in IoTDB.
206
207
@@ -276,7 +277,7 @@ class TableSessionPoolConfig(object):
276
277
- Ensure that `TableSession` instances retrieved from the `TableSessionPool` are properly closed after use.
277
278
- After closing the `TableSessionPool`, it will no longer be possible to retrieve new sessions.
278
279
279
-
## Sample Code
280
+
## 4. Sample Code
280
281
281
282
**Session** Example: You can find the full example code at [GitHub Repository](https://github.com/apache/iotdb/blob/master/iotdb-client/client-py/table_model_session_example.py).
Copy file name to clipboardExpand all lines: src/UserGuide/Master/Table/API/RestAPI-V1.md
+44-43Lines changed: 44 additions & 43 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,18 +18,19 @@
18
18
under the License.
19
19
20
20
-->
21
+
# RestAPI V1
21
22
22
23
IoTDB's RESTful service can be used for querying, writing, and management operations. It uses the OpenAPI standard to define interfaces and generate frameworks.
23
24
24
-
###Enabling RESTful Service
25
+
##1. Enabling RESTful Service
25
26
26
27
The RESTful service is disabled by default. To enable it, locate the `conf/iotdb-system.properties` file in the IoTDB installation directory, set `enable_rest_service` to `true`, and then restart the datanode process.
27
28
28
29
```Properties
29
30
enable_rest_service=true
30
31
```
31
32
32
-
###Authentication
33
+
##2. Authentication
33
34
34
35
Except for the health check endpoint `/ping`, the RESTful service uses basic authentication. Each URL request must include the header `'Authorization':'Basic' + base64.encode(username + ':' + password)`.
@@ -252,86 +253,86 @@ The `/ping` endpoint can be used for online service health checks.
252
253
"code": 200,
253
254
"message": "SUCCESS_STATUS"
254
255
}
255
-
```
256
+
```
256
257
257
-
### Configuration
258
+
## 4. Configuration
258
259
259
260
The configuration file is located in `iotdb-system.properties`.
260
261
261
262
- Set `enable_rest_service` to `true` to enable the module, or `false` to disable it. The default value is `false`.
262
263
263
-
```Plain
264
+
```Properties
264
265
enable_rest_service=true
265
-
```
266
+
```
266
267
267
268
- Only effective when `enable_rest_service=true`. Set `rest_service_port` to a number (1025~65535) to customize the REST service socket port. The default value is `18080`.
268
269
269
-
```Plain
270
+
```Properties
270
271
rest_service_port=18080
271
-
```
272
+
```
272
273
273
274
- Set `enable_swagger` to `true` to enable Swagger for displaying REST interface information, or `false` to disable it. The default value is `false`.
274
275
275
-
```Plain
276
+
```Properties
276
277
enable_swagger=false
277
-
```
278
+
```
278
279
279
280
- The maximum number of rows that can be returned in a single query. If the result set exceeds this limit, only the rows within the limit will be returned, and status code `411` will be returned.
280
281
281
-
```Plain
282
+
```Properties
282
283
rest_query_default_row_size_limit=10000
283
-
```
284
+
```
284
285
285
286
- Expiration time for caching client login information (used to speed up user authentication, in seconds, default is 8 hours).
286
287
287
-
```Plain
288
+
```Properties
288
289
cache_expire_in_seconds=28800
289
-
```
290
+
```
290
291
291
292
- Maximum number of users stored in the cache (default is 100).
292
293
293
-
```Plain
294
+
```Properties
294
295
cache_max_num=100
295
-
```
296
+
```
296
297
297
298
- Initial cache capacity (default is 10).
298
299
299
-
```Plain
300
+
```Properties
300
301
cache_init_num=10
301
-
```
302
+
```
302
303
303
304
- Whether to enable SSL configuration for the REST service. Set `enable_https` to `true` to enable it, or `false` to disable it. The default value is `false`.
0 commit comments