diff --git a/src/.vuepress/sidebar/V2.0.x/en-Table.ts b/src/.vuepress/sidebar/V2.0.x/en-Table.ts index fb6d4455a..823c6151c 100644 --- a/src/.vuepress/sidebar/V2.0.x/en-Table.ts +++ b/src/.vuepress/sidebar/V2.0.x/en-Table.ts @@ -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' }, + ], + }, ], }, { diff --git a/src/.vuepress/sidebar/V2.0.x/zh-Table.ts b/src/.vuepress/sidebar/V2.0.x/zh-Table.ts index 6361b1d33..2f3e1ab73 100644 --- a/src/.vuepress/sidebar/V2.0.x/zh-Table.ts +++ b/src/.vuepress/sidebar/V2.0.x/zh-Table.ts @@ -158,6 +158,13 @@ export const zhSidebar = { { text: 'DBeaver', link: 'DBeaver' }, ], }, + { + text: '编程框架', + collapsible: true, + children: [ + { text: 'Spring Boot Starter', link: 'Spring-Boot-Starter' }, + ], + }, ], }, { diff --git a/src/.vuepress/sidebar_timecho/V2.0.x/en-Table.ts b/src/.vuepress/sidebar_timecho/V2.0.x/en-Table.ts index 2620c9f23..5675f3246 100644 --- a/src/.vuepress/sidebar_timecho/V2.0.x/en-Table.ts +++ b/src/.vuepress/sidebar_timecho/V2.0.x/en-Table.ts @@ -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' }, + ], + }, ], }, { diff --git a/src/.vuepress/sidebar_timecho/V2.0.x/zh-Table.ts b/src/.vuepress/sidebar_timecho/V2.0.x/zh-Table.ts index 135414f0a..6b4df32de 100644 --- a/src/.vuepress/sidebar_timecho/V2.0.x/zh-Table.ts +++ b/src/.vuepress/sidebar_timecho/V2.0.x/zh-Table.ts @@ -162,6 +162,13 @@ export const zhSidebar = { { text: 'DBeaver', link: 'DBeaver' }, ], }, + { + text: '编程框架', + collapsible: true, + children: [ + { text: 'Spring Boot Starter', link: 'Spring-Boot-Starter' }, + ], + }, ], }, { diff --git a/src/UserGuide/Master/Table/Ecosystem-Integration/Spring-Boot-Starter.md b/src/UserGuide/Master/Table/Ecosystem-Integration/Spring-Boot-Starter.md new file mode 100644 index 000000000..8cfc1a419 --- /dev/null +++ b/src/UserGuide/Master/Table/Ecosystem-Integration/Spring-Boot-Starter.md @@ -0,0 +1,87 @@ + + +# 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 + + org.apache.iotdb + iotdb-spring-boot-starter + 2.0.3 + +``` + +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 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) diff --git a/src/UserGuide/latest-Table/Ecosystem-Integration/Spring-Boot-Starter.md b/src/UserGuide/latest-Table/Ecosystem-Integration/Spring-Boot-Starter.md new file mode 100644 index 000000000..8cfc1a419 --- /dev/null +++ b/src/UserGuide/latest-Table/Ecosystem-Integration/Spring-Boot-Starter.md @@ -0,0 +1,87 @@ + + +# 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 + + org.apache.iotdb + iotdb-spring-boot-starter + 2.0.3 + +``` + +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 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) diff --git a/src/zh/UserGuide/Master/Table/Ecosystem-Integration/Spring-Boot-Starter.md b/src/zh/UserGuide/Master/Table/Ecosystem-Integration/Spring-Boot-Starter.md new file mode 100644 index 000000000..312452743 --- /dev/null +++ b/src/zh/UserGuide/Master/Table/Ecosystem-Integration/Spring-Boot-Starter.md @@ -0,0 +1,89 @@ + + +# 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 + + org.apache.iotdb + iotdb-spring-boot-starter + 2.0.3 + +``` + +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 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) diff --git a/src/zh/UserGuide/latest-Table/Ecosystem-Integration/Spring-Boot-Starter.md b/src/zh/UserGuide/latest-Table/Ecosystem-Integration/Spring-Boot-Starter.md new file mode 100644 index 000000000..312452743 --- /dev/null +++ b/src/zh/UserGuide/latest-Table/Ecosystem-Integration/Spring-Boot-Starter.md @@ -0,0 +1,89 @@ + + +# 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 + + org.apache.iotdb + iotdb-spring-boot-starter + 2.0.3 + +``` + +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 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)