[JAVA-6232]: Introduction to QuestDB (#13542)

* [JAVA-6232]: Introduction to QuestDB

* [FIX] Add questdb version as property

* JAVA-6232: Change parent folder
This commit is contained in:
Harry9656 2023-03-21 07:40:18 +01:00 committed by GitHub
parent 4c2dcb190f
commit e30dc4dbc3
4 changed files with 62 additions and 0 deletions

View File

@ -0,0 +1,2 @@
### Relevant Articles:
- [Introduction to QuestDB](#)

View File

@ -0,0 +1,29 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.baeldung</groupId>
<artifactId>questdb</artifactId>
<name>questdb</name>
<version>0.0.1-SNAPSHOT</version>
<parent>
<groupId>com.baeldung</groupId>
<artifactId>parent-java</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../../parent-java</relativePath>
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<questdb.version>7.0.0</questdb.version>
</properties>
<dependencies>
<dependency>
<groupId>org.questdb</groupId>
<artifactId>questdb</artifactId>
<version>${questdb.version}</version>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,29 @@
package com.baeldung;
import io.questdb.client.Sender;
public class InsertData {
static final String SENSORS_TABLE_NAME = "sensors";
public static void main(String[] args) {
try (Sender sender = Sender.builder().address("localhost:9009").build()) {
sender.table(SENSORS_TABLE_NAME)
.stringColumn("id", "KTC")
.stringColumn("name", "Kitchen temperature (Celsius)")
.doubleColumn("currentValue", 20)
.atNow();
sender.table(SENSORS_TABLE_NAME)
.stringColumn("id", "SMT")
.stringColumn("name", "Smart Garden temperature (Celsius)")
.doubleColumn("currentValue", 28.5)
.atNow();
sender.table(SENSORS_TABLE_NAME)
.stringColumn("id", "RM1")
.stringColumn("name", "Room 1")
.doubleColumn("currentValue", 19.5)
.doubleColumn("idealValue", 18.5)
.atNow();
}
}
}

View File

@ -979,6 +979,7 @@
<module>persistence-modules/java-mongodb</module> <module>persistence-modules/java-mongodb</module>
<module>messaging-modules</module> <module>messaging-modules</module>
<module>spring-boot-modules/spring-boot-redis</module> <module>spring-boot-modules/spring-boot-redis</module>
<module>persistence-modules/questdb</module>
</modules> </modules>
<properties> <properties>
@ -1251,6 +1252,7 @@
<module>libraries-2</module> <module>libraries-2</module>
<module>messaging-modules</module> <module>messaging-modules</module>
<module>spring-boot-modules/spring-boot-redis</module> <module>spring-boot-modules/spring-boot-redis</module>
<module>persistence-modules/questdb</module>
</modules> </modules>
<properties> <properties>