Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 13 additions & 18 deletions documentation/ingestion/clients/java.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import TabItem from "@theme/TabItem"

import CodeBlock from "@theme/CodeBlock"

import InterpolateReleaseData from "../../../src/components/InterpolateReleaseData"

import { RemoteRepoExample } from "@theme/RemoteRepoExample"

:::note
Expand All @@ -25,7 +23,8 @@ For embedded QuestDB, please check our

:::

The QuestDB Java client is baked right into the QuestDB binary.
The QuestDB Java client is distributed as a separate Maven artifact
(`org.questdb:client`).

The client provides the following benefits:

Expand Down Expand Up @@ -58,31 +57,27 @@ Here is a list of known incompatible JDKs:

## Quick start

Add QuestDB as a dependency in your project's build configuration file.
Add the QuestDB Java client as a dependency in your project's build configuration file.

<Tabs defaultValue="maven" values={[ { label: "Maven", value: "maven" },
{ label: "Gradle", value: "gradle" }, ]}

> <TabItem value="maven">

<InterpolateReleaseData
renderText={(release) => (
<CodeBlock className="language-xml">
{`<dependency>
<CodeBlock className="language-xml">
{`<dependency>
<groupId>org.questdb</groupId>
<artifactId>questdb</artifactId>
<version>${release.name}</version>
<artifactId>client</artifactId>
<version>1.0.0</version>
</dependency>`}
</CodeBlock>
)}
/>
</CodeBlock>
</TabItem>
<TabItem value="gradle">
<InterpolateReleaseData
renderText={(release) => (
<CodeBlock className="language-text">
{`compile group: 'org.questdb', name: 'questdb', version: '${release.name}'`}
</CodeBlock> )} /> </TabItem> </Tabs>
<CodeBlock className="language-text">
{`implementation 'org.questdb:client:1.0.0'`}
</CodeBlock>
</TabItem>
</Tabs>

The code below creates a client instance configured to use HTTP transport to
connect to a QuestDB server running on localhost, port 9000. It then sends two
Expand Down
20 changes: 6 additions & 14 deletions src/components/InsertDataJava/index.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
import React from "react"
import InterpolateReleaseData from "../InterpolateReleaseData"
import CodeBlock from "@theme/CodeBlock"
import { Release } from "../../utils"

const InsertDataJava = () => {
return (
<InterpolateReleaseData
renderText={(release: Release) => {
return (
<CodeBlock className="language-java">
{`
<CodeBlock className="language-java">
{`
import io.questdb.cutlass.line.LineTcpSender;
import io.questdb.network.Net;
import io.questdb.std.Os;
Expand All @@ -20,13 +15,13 @@ public class LineTCPSenderMain {

<dependency>
<groupId>org.questdb</groupId>
<artifactId>questdb</artifactId>
<version>${release.name}</version>
<artifactId>client</artifactId>
<version>1.0.0</version>
</dependency>

Gradle:

compile group: 'org.questdb', name: 'questdb', version: '${release.name}'
implementation 'org.questdb:client:1.0.0'

*/
public static void main(String[] args) {
Expand All @@ -51,10 +46,7 @@ public class LineTCPSenderMain {
}
}
`}
</CodeBlock>
)
}}
/>
</CodeBlock>
)
}

Expand Down