Skip to content

Latest commit

 

History

History
43 lines (31 loc) · 2.04 KB

README.md

File metadata and controls

43 lines (31 loc) · 2.04 KB

Spring Boot Session example

This application uses Spring Boot 3.5.1, JDK 17+ and IoTDB client 2.0.11 through the locally built Extras starter (2.0.12-SNAPSHOT).

Build from the repository root:

mvn -Pwith-springboot,with-examples -pl examples/iotdb-spring-boot-start -am clean install

Start IoTDB 2.0.11. In the table dialect, create the database/table used by IoTDBService:

CREATE DATABASE IF NOT EXISTS wind;
USE wind;
CREATE TABLE IF NOT EXISTS power_data_set (device STRING TAG, value DOUBLE FIELD);
INSERT INTO power_data_set(time, device, value) VALUES (1, 'demo', 42.0);

Edit src/main/resources/application.properties for your endpoints and credentials, then run IoTDBSpringBootStartApplication from the IDE or mvn spring-boot:run in this directory. The service exposes queryTableSessionPool() and querySessionPool() for invocation from application code; startup itself does not issue those queries.

Both methods close results and return borrowed sessions even on exceptions. The commented live-query test requires a server and is not part of the offline unit-test suite. See the starter reference for configuration defaults, custom pools and transaction limitations.