Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/.vuepress/sidebar/V2.0.x/en-Table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,13 @@ export const enSidebar = {
{ text: 'DBeaver', link: 'DBeaver' },
],
},
{
text: 'Programming Framework',
collapsible: true,
children: [
{ text: 'Spring Boot Starter', link: 'Spring-Boot-Starter' },
],
},
],
},
{
Expand Down
7 changes: 7 additions & 0 deletions src/.vuepress/sidebar/V2.0.x/zh-Table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,13 @@ export const zhSidebar = {
{ text: 'DBeaver', link: 'DBeaver' },
],
},
{
text: '编程框架',
collapsible: true,
children: [
{ text: 'Spring Boot Starter', link: 'Spring-Boot-Starter' },
],
},
],
},
{
Expand Down
7 changes: 7 additions & 0 deletions src/.vuepress/sidebar_timecho/V2.0.x/en-Table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,13 @@ export const enSidebar = {
{ text: 'DBeaver', link: 'DBeaver' },
],
},
{
text: 'Programming Framework',
collapsible: true,
children: [
{ text: 'Spring Boot Starter', link: 'Spring-Boot-Starter' },
],
},
],
},
{
Expand Down
7 changes: 7 additions & 0 deletions src/.vuepress/sidebar_timecho/V2.0.x/zh-Table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,13 @@ export const zhSidebar = {
{ text: 'DBeaver', link: 'DBeaver' },
],
},
{
text: '编程框架',
collapsible: true,
children: [
{ text: 'Spring Boot Starter', link: 'Spring-Boot-Starter' },
],
},
],
},
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<!--

Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.

-->

# Spring Boot Starter

## 1. Overview
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.

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.

## 2. Usage Steps

### 2.1 Version Requirements

* `IoTDB: >=2.0.3`
* `iotdb-spring-boot-starter: >=2.0.3`

### 2.2 Procedure

1. Install and start IoTDB, refer to [IoTDB QuickStart](../QuickStart/QuickStart.md)
2. Add the Maven dependency to your project

```xml
<dependency>
<groupId>org.apache.iotdb</groupId>
<artifactId>iotdb-spring-boot-starter</artifactId>
<version>2.0.3</version>
</dependency>
```

3. Configure custom settings in `application.properties`:

```Properties
# IoTDB service address (format: IP:Port)
iotdb.session.url=127.0.0.1:6667
# IoTDB username
iotdb.session.username=root
# IoTDB password
iotdb.session.password=root
# Default SQL dialect
iotdb.session.sql-dialect=table
# Default database
iotdb.session.database=wind
# Connection pool max size
iotdb.session.max-size=10
```

4. Use the target Bean via `@Autowired`, for example

```java
@Autowired
private ITableSessionPool ioTDBSessionPool;

public void queryTableSessionPool() throws IoTDBConnectionException, StatementExecutionException {
ITableSession tableSession = ioTDBSessionPool.getSession();
final SessionDataSet sessionDataSet = tableSession.executeQueryStatement("select * from table1 limit 10");
while (sessionDataSet.hasNext()) {
final RowRecord rowRecord = sessionDataSet.next();
final List<Field> fields = rowRecord.getFields();
for (Field field : fields) {
System.out.print(field.getStringValue());
}
System.out.println();
}
}
```

## 3. Usage Examples
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)
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<!--

Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.

-->

# Spring Boot Starter

## 1. Overview
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.

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.

## 2. Usage Steps

### 2.1 Version Requirements

* `IoTDB: >=2.0.3`
* `iotdb-spring-boot-starter: >=2.0.3`

### 2.2 Procedure

1. Install and start IoTDB, refer to [IoTDB QuickStart](../QuickStart/QuickStart.md)
2. Add the Maven dependency to your project

```xml
<dependency>
<groupId>org.apache.iotdb</groupId>
<artifactId>iotdb-spring-boot-starter</artifactId>
<version>2.0.3</version>
</dependency>
```

3. Configure custom settings in `application.properties`:

```Properties
# IoTDB service address (format: IP:Port)
iotdb.session.url=127.0.0.1:6667
# IoTDB username
iotdb.session.username=root
# IoTDB password
iotdb.session.password=root
# Default SQL dialect
iotdb.session.sql-dialect=table
# Default database
iotdb.session.database=wind
# Connection pool max size
iotdb.session.max-size=10
```

4. Use the target Bean via `@Autowired`, for example

```java
@Autowired
private ITableSessionPool ioTDBSessionPool;

public void queryTableSessionPool() throws IoTDBConnectionException, StatementExecutionException {
ITableSession tableSession = ioTDBSessionPool.getSession();
final SessionDataSet sessionDataSet = tableSession.executeQueryStatement("select * from table1 limit 10");
while (sessionDataSet.hasNext()) {
final RowRecord rowRecord = sessionDataSet.next();
final List<Field> fields = rowRecord.getFields();
for (Field field : fields) {
System.out.print(field.getStringValue());
}
System.out.println();
}
}
```

## 3. Usage Examples
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)
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<!--

Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.

-->

# Spring Boot Starter

## 1. 概述

Spring Boot Starter 是 Spring Boot 生态中的核心模块化组件,通过预定义依赖集合与自动化配置机制,简化第三方技术栈(如数据库、消息队列、安全框架)与 Spring Boot 应用的集成流程。每个 Starter 封装了特定功能所需的核心库、默认配置及条件化初始化逻辑,开发者仅需引入依赖即可实现“零配置”集成,遵循“约定优于配置”原则。

IoTDB 官方提供的 `iotdb-spring-boot-starter` 是专为 Spring Boot 生态设计的标准化集成组件,帮助开发者快速实现时序数据库的高效接入。开发者仅需引入依赖,即可使用 IoTDB 功能或模块,显著降低时序数据场景下的技术集成复杂度,适用于物联网、工业互联网等高频时序数据存储与分析场景。

## 2. 使用步骤

### 2.1 版本要求

* `IoTDB: >=2.0.3`
* `iotdb-spring-boot-starter: >=2.0.3`

### 2.2 操作流程

1. 安装并启动 IoTDB , 可参考 [IoTDB 快速入门](../QuickStart/QuickStart.md)
2. 在项目中添加 Maven 依赖

```xml
<dependency>
<groupId>org.apache.iotdb</groupId>
<artifactId>iotdb-spring-boot-starter</artifactId>
<version>2.0.3</version>
</dependency>
```

3. 在 `application.properties` 文件中进行自定义配置

```Properties
# IoTDB 服务地址(格式:IP:Port)
iotdb.session.url=127.0.0.1:6667
# IoTDB 用户名
iotdb.session.username=root
# IoTDB 用户密码
iotdb.session.password=root
# 指定连接的默认模式
iotdb.session.sql-dialect=table
# 指定连接的默认数据库
iotdb.session.database=wind
# 连接池最大连接数
iotdb.session.max-size=10
```

4. 通过 @Autowired 使用目标 Bean,例如

```java
@Autowired
private ITableSessionPool ioTDBSessionPool;

public void queryTableSessionPool() throws IoTDBConnectionException, StatementExecutionException {
ITableSession tableSession = ioTDBSessionPool.getSession();
final SessionDataSet sessionDataSet = tableSession.executeQueryStatement("select * from table1 limit 10");
while (sessionDataSet.hasNext()) {
final RowRecord rowRecord = sessionDataSet.next();
final List<Field> fields = rowRecord.getFields();
for (Field field : fields) {
System.out.print(field.getStringValue());
}
System.out.println();
}
}
```

## 3. 使用示例

详细的使用示例可参考源码 [examples/iotdb-spring-boot-start](https://github.com/apache/iotdb-extras/tree/master/examples/iotdb-spring-boot-start)
Loading