Skip to content

Commit 6814db9

Browse files
committed
add srpingboot starter to table model
1 parent 3a3f4b5 commit 6814db9

8 files changed

Lines changed: 380 additions & 0 deletions

File tree

src/.vuepress/sidebar/V2.0.x/en-Table.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,13 @@ export const enSidebar = {
168168
{ text: 'DBeaver', link: 'DBeaver' },
169169
],
170170
},
171+
{
172+
text: 'Programming Framework',
173+
collapsible: true,
174+
children: [
175+
{ text: 'Spring Boot Starter', link: 'Spring-Boot-Starter' },
176+
],
177+
},
171178
],
172179
},
173180
{

src/.vuepress/sidebar/V2.0.x/zh-Table.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,13 @@ export const zhSidebar = {
158158
{ text: 'DBeaver', link: 'DBeaver' },
159159
],
160160
},
161+
{
162+
text: '编程框架',
163+
collapsible: true,
164+
children: [
165+
{ text: 'Spring Boot Starter', link: 'Spring-Boot-Starter' },
166+
],
167+
},
161168
],
162169
},
163170
{

src/.vuepress/sidebar_timecho/V2.0.x/en-Table.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,13 @@ export const enSidebar = {
173173
{ text: 'DBeaver', link: 'DBeaver' },
174174
],
175175
},
176+
{
177+
text: 'Programming Framework',
178+
collapsible: true,
179+
children: [
180+
{ text: 'Spring Boot Starter', link: 'Spring-Boot-Starter' },
181+
],
182+
},
176183
],
177184
},
178185
{

src/.vuepress/sidebar_timecho/V2.0.x/zh-Table.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,13 @@ export const zhSidebar = {
162162
{ text: 'DBeaver', link: 'DBeaver' },
163163
],
164164
},
165+
{
166+
text: '编程框架',
167+
collapsible: true,
168+
children: [
169+
{ text: 'Spring Boot Starter', link: 'Spring-Boot-Starter' },
170+
],
171+
},
165172
],
166173
},
167174
{
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
<!--
2+
3+
Licensed to the Apache Software Foundation (ASF) under one
4+
or more contributor license agreements. See the NOTICE file
5+
distributed with this work for additional information
6+
regarding copyright ownership. The ASF licenses this file
7+
to you under the Apache License, Version 2.0 (the
8+
"License"); you may not use this file except in compliance
9+
with the License. You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing,
14+
software distributed under the License is distributed on an
15+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
KIND, either express or implied. See the License for the
17+
specific language governing permissions and limitations
18+
under the License.
19+
20+
-->
21+
22+
# Spring Boot Starter
23+
24+
## 1. Overview
25+
The Spring Boot Starter is a core modular component in the Spring Boot ecosystem. It simplifies the integration of third-party technologies (such as databases, message queues, and security frameworks) with Spring Boot applications through predefined dependency sets and automated configuration mechanisms. Each Starter encapsulates the core libraries, default configurations, and conditional initialization logic required for specific functionalities. Developers only need to include the dependency to achieve "zero-configuration" integration, adhering to the "convention over configuration" principle.
26+
27+
The officially provided iotdb-spring-boot-starter by IoTDB is a standardized integration component designed for the Spring Boot ecosystem, enabling developers to quickly and efficiently connect with time-series databases. By simply adding the dependency, developers can leverage IoTDB functionalities or modules, significantly reducing the complexity of technical integration in time-series data scenarios. This is particularly suitable for applications involving IoT, industrial internet, and other high-frequency time-series data storage and analysis.
28+
29+
## 2. Usage Steps
30+
31+
### 2.1 Version Requirements
32+
33+
* `IoTDB: >=2.0.3`
34+
* `iotdb-spring-boot-starter: >=2.0.3`
35+
36+
### 2.2 Procedure
37+
38+
1. Install and start IoTDB, refer to [IoTDB QuickStart](../QuickStart/QuickStart.md)
39+
2. Add the Maven dependency to your project
40+
41+
```xml
42+
<dependency>
43+
<groupId>org.apache.iotdb</groupId>
44+
<artifactId>iotdb-spring-boot-starter</artifactId>
45+
<version>2.0.3</version>
46+
</dependency>
47+
```
48+
49+
3. Configure custom settings in `application.properties`:
50+
51+
```Properties
52+
# IoTDB service address (format: IP:Port)
53+
iotdb.session.url=127.0.0.1:6667
54+
# IoTDB username
55+
iotdb.session.username=root
56+
# IoTDB password
57+
iotdb.session.password=root
58+
# Default SQL dialect
59+
iotdb.session.sql-dialect=table
60+
# Default database
61+
iotdb.session.database=wind
62+
# Connection pool max size
63+
iotdb.session.max-size=10
64+
```
65+
66+
4. Use the target Bean via `@Autowired`, for example
67+
68+
```java
69+
@Autowired
70+
private ITableSessionPool ioTDBSessionPool;
71+
72+
public void queryTableSessionPool() throws IoTDBConnectionException, StatementExecutionException {
73+
ITableSession tableSession = ioTDBSessionPool.getSession();
74+
final SessionDataSet sessionDataSet = tableSession.executeQueryStatement("select * from table1 limit 10");
75+
while (sessionDataSet.hasNext()) {
76+
final RowRecord rowRecord = sessionDataSet.next();
77+
final List<Field> fields = rowRecord.getFields();
78+
for (Field field : fields) {
79+
System.out.print(field.getStringValue());
80+
}
81+
System.out.println();
82+
}
83+
}
84+
```
85+
86+
## 3. Usage Examples
87+
For detailed examples, refer to the source code [examples/iotdb-spring-boot-start](https://github.com/apache/iotdb-extras/tree/master/examples/iotdb-spring-boot-start)
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
<!--
2+
3+
Licensed to the Apache Software Foundation (ASF) under one
4+
or more contributor license agreements. See the NOTICE file
5+
distributed with this work for additional information
6+
regarding copyright ownership. The ASF licenses this file
7+
to you under the Apache License, Version 2.0 (the
8+
"License"); you may not use this file except in compliance
9+
with the License. You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing,
14+
software distributed under the License is distributed on an
15+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
KIND, either express or implied. See the License for the
17+
specific language governing permissions and limitations
18+
under the License.
19+
20+
-->
21+
22+
# Spring Boot Starter
23+
24+
## 1. Overview
25+
The Spring Boot Starter is a core modular component in the Spring Boot ecosystem. It simplifies the integration of third-party technologies (such as databases, message queues, and security frameworks) with Spring Boot applications through predefined dependency sets and automated configuration mechanisms. Each Starter encapsulates the core libraries, default configurations, and conditional initialization logic required for specific functionalities. Developers only need to include the dependency to achieve "zero-configuration" integration, adhering to the "convention over configuration" principle.
26+
27+
The officially provided iotdb-spring-boot-starter by IoTDB is a standardized integration component designed for the Spring Boot ecosystem, enabling developers to quickly and efficiently connect with time-series databases. By simply adding the dependency, developers can leverage IoTDB functionalities or modules, significantly reducing the complexity of technical integration in time-series data scenarios. This is particularly suitable for applications involving IoT, industrial internet, and other high-frequency time-series data storage and analysis.
28+
29+
## 2. Usage Steps
30+
31+
### 2.1 Version Requirements
32+
33+
* `IoTDB: >=2.0.3`
34+
* `iotdb-spring-boot-starter: >=2.0.3`
35+
36+
### 2.2 Procedure
37+
38+
1. Install and start IoTDB, refer to [IoTDB QuickStart](../QuickStart/QuickStart.md)
39+
2. Add the Maven dependency to your project
40+
41+
```xml
42+
<dependency>
43+
<groupId>org.apache.iotdb</groupId>
44+
<artifactId>iotdb-spring-boot-starter</artifactId>
45+
<version>2.0.3</version>
46+
</dependency>
47+
```
48+
49+
3. Configure custom settings in `application.properties`:
50+
51+
```Properties
52+
# IoTDB service address (format: IP:Port)
53+
iotdb.session.url=127.0.0.1:6667
54+
# IoTDB username
55+
iotdb.session.username=root
56+
# IoTDB password
57+
iotdb.session.password=root
58+
# Default SQL dialect
59+
iotdb.session.sql-dialect=table
60+
# Default database
61+
iotdb.session.database=wind
62+
# Connection pool max size
63+
iotdb.session.max-size=10
64+
```
65+
66+
4. Use the target Bean via `@Autowired`, for example
67+
68+
```java
69+
@Autowired
70+
private ITableSessionPool ioTDBSessionPool;
71+
72+
public void queryTableSessionPool() throws IoTDBConnectionException, StatementExecutionException {
73+
ITableSession tableSession = ioTDBSessionPool.getSession();
74+
final SessionDataSet sessionDataSet = tableSession.executeQueryStatement("select * from table1 limit 10");
75+
while (sessionDataSet.hasNext()) {
76+
final RowRecord rowRecord = sessionDataSet.next();
77+
final List<Field> fields = rowRecord.getFields();
78+
for (Field field : fields) {
79+
System.out.print(field.getStringValue());
80+
}
81+
System.out.println();
82+
}
83+
}
84+
```
85+
86+
## 3. Usage Examples
87+
For detailed examples, refer to the source code [examples/iotdb-spring-boot-start](https://github.com/apache/iotdb-extras/tree/master/examples/iotdb-spring-boot-start)
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
<!--
2+
3+
Licensed to the Apache Software Foundation (ASF) under one
4+
or more contributor license agreements. See the NOTICE file
5+
distributed with this work for additional information
6+
regarding copyright ownership. The ASF licenses this file
7+
to you under the Apache License, Version 2.0 (the
8+
"License"); you may not use this file except in compliance
9+
with the License. You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing,
14+
software distributed under the License is distributed on an
15+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
KIND, either express or implied. See the License for the
17+
specific language governing permissions and limitations
18+
under the License.
19+
20+
-->
21+
22+
# Spring Boot Starter
23+
24+
## 1. 概述
25+
26+
Spring Boot Starter 是 Spring Boot 生态中的核心模块化组件,通过预定义依赖集合与自动化配置机制,简化第三方技术栈(如数据库、消息队列、安全框架)与 Spring Boot 应用的集成流程。每个 Starter 封装了特定功能所需的核心库、默认配置及条件化初始化逻辑,开发者仅需引入依赖即可实现“零配置”集成,遵循“约定优于配置”原则。
27+
28+
IoTDB 官方提供的 `iotdb-spring-boot-starter` 是专为 Spring Boot 生态设计的标准化集成组件,帮助开发者快速实现时序数据库的高效接入。开发者仅需引入依赖,即可使用 IoTDB 功能或模块,显著降低时序数据场景下的技术集成复杂度,适用于物联网、工业互联网等高频时序数据存储与分析场景。
29+
30+
## 2. 使用步骤
31+
32+
### 2.1 版本要求
33+
34+
* `IoTDB: >=2.0.3`
35+
* `iotdb-spring-boot-starter: >=2.0.3`
36+
37+
### 2.2 操作流程
38+
39+
1. 安装并启动 IoTDB , 可参考 [IoTDB 快速入门](../QuickStart/QuickStart.md)
40+
2. 在项目中添加 Maven 依赖
41+
42+
```xml
43+
<dependency>
44+
<groupId>org.apache.iotdb</groupId>
45+
<artifactId>iotdb-spring-boot-starter</artifactId>
46+
<version>2.0.3</version>
47+
</dependency>
48+
```
49+
50+
3.`application.properties` 文件中进行自定义配置
51+
52+
```Properties
53+
# IoTDB 服务地址(格式:IP:Port)
54+
iotdb.session.url=127.0.0.1:6667
55+
# IoTDB 用户名
56+
iotdb.session.username=root
57+
# IoTDB 用户密码
58+
iotdb.session.password=root
59+
# 指定连接的默认模式
60+
iotdb.session.sql-dialect=table
61+
# 指定连接的默认数据库
62+
iotdb.session.database=wind
63+
# 连接池最大连接数
64+
iotdb.session.max-size=10
65+
```
66+
67+
4. 通过 @Autowired 使用目标 Bean,例如
68+
69+
```java
70+
@Autowired
71+
private ITableSessionPool ioTDBSessionPool;
72+
73+
public void queryTableSessionPool() throws IoTDBConnectionException, StatementExecutionException {
74+
ITableSession tableSession = ioTDBSessionPool.getSession();
75+
final SessionDataSet sessionDataSet = tableSession.executeQueryStatement("select * from table1 limit 10");
76+
while (sessionDataSet.hasNext()) {
77+
final RowRecord rowRecord = sessionDataSet.next();
78+
final List<Field> fields = rowRecord.getFields();
79+
for (Field field : fields) {
80+
System.out.print(field.getStringValue());
81+
}
82+
System.out.println();
83+
}
84+
}
85+
```
86+
87+
## 3. 使用示例
88+
89+
详细的使用示例可参考源码 [examples/iotdb-spring-boot-start](https://github.com/apache/iotdb-extras/tree/master/examples/iotdb-spring-boot-start)

0 commit comments

Comments
 (0)