[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:
parent
4c2dcb190f
commit
e30dc4dbc3
|
@ -0,0 +1,2 @@
|
|||
### Relevant Articles:
|
||||
- [Introduction to QuestDB](#)
|
|
@ -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>
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
2
pom.xml
2
pom.xml
|
@ -979,6 +979,7 @@
|
|||
<module>persistence-modules/java-mongodb</module>
|
||||
<module>messaging-modules</module>
|
||||
<module>spring-boot-modules/spring-boot-redis</module>
|
||||
<module>persistence-modules/questdb</module>
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
|
@ -1251,6 +1252,7 @@
|
|||
<module>libraries-2</module>
|
||||
<module>messaging-modules</module>
|
||||
<module>spring-boot-modules/spring-boot-redis</module>
|
||||
<module>persistence-modules/questdb</module>
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
|
|
Loading…
Reference in New Issue