[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
@@ -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();
}
}
}