Skip to content

Commit 4a34335

Browse files
author
Paultagoras
committed
Update jdbc-v2.md
1 parent c9fcffb commit 4a34335

File tree

1 file changed

+9
-48
lines changed
  • docs/en/integrations/language-clients/java

1 file changed

+9
-48
lines changed

docs/en/integrations/language-clients/java/jdbc-v2.md

Lines changed: 9 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,8 @@ import CodeBlock from '@theme/CodeBlock';
1313

1414
# JDBC Driver
1515

16-
`clickhouse-jdbc` implements the standard JDBC interface. Being built on top of [clickhouse-client](/docs/en/integrations/sql-clients/sql-console), it provides additional features like custom type mapping, transaction support, and standard synchronous `UPDATE` and `DELETE` statements, etc., so that it can be easily used with legacy applications and tools.
17-
18-
:::note
19-
Latest JDBC (0.8.0) version uses Client-V2 by default.
20-
:::
21-
22-
`clickhouse-jdbc` API is synchronous, and generally, it has more overheads (e.g., SQL parsing and type mapping/conversion, etc.). Consider [client-v2](/docs/en/integrations/language-clients/java/client-v2.md) when performance is critical or if you prefer a more direct way to access ClickHouse.
16+
`clickhouse-jdbc` implements the standard JDBC interface using [client-v2](/docs/en/integrations/language-clients/java/client-v2.md).
17+
We recommend using [client-v2](/docs/en/integrations/language-clients/java/client-v2.md) directly if performance/direct access is critical.
2318

2419
## Environment requirements
2520

@@ -37,7 +32,6 @@ import CodeBlock from '@theme/CodeBlock';
3732
<groupId>com.clickhouse</groupId>
3833
<artifactId>clickhouse-jdbc</artifactId>
3934
<version>0.8.0</version>
40-
<!-- use uber jar with all dependencies included, change classifier to http for smaller jar -->
4135
<classifier>shaded-all</classifier>
4236
</dependency>
4337
```
@@ -47,72 +41,39 @@ import CodeBlock from '@theme/CodeBlock';
4741

4842
```kotlin
4943
// https://mvnrepository.com/artifact/com.clickhouse/clickhouse-jdbc
50-
// use uber jar with all dependencies included, change classifier to http for smaller jar
5144
implementation("com.clickhouse:clickhouse-jdbc:0.8.0:shaded-all")
5245
```
5346
</TabItem>
5447
<TabItem value="gradle" label="Gradle">
5548

5649
```groovy
5750
// https://mvnrepository.com/artifact/com.clickhouse/clickhouse-jdbc
58-
// use uber jar with all dependencies included, change classifier to http for smaller jar
5951
implementation 'com.clickhouse:clickhouse-jdbc:0.8.0:shaded-all'
6052
```
6153

6254
</TabItem>
6355
</Tabs>
6456

65-
Since version `0.5.0`, we are using Apache HTTP Client that's packed the Client. Since there is not a shared version of the package, you need to add a logger as a dependency.
66-
67-
<Tabs groupId="jdbc-logging-dependency">
68-
<TabItem value="maven" label="Maven" >
69-
70-
```xml
71-
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-api -->
72-
<dependency>
73-
<groupId>org.slf4j</groupId>
74-
<artifactId>slf4j-api</artifactId>
75-
<version>2.0.16</version>
76-
</dependency>
77-
```
78-
79-
</TabItem>
80-
<TabItem value="gradle-kt" label="Gradle (Kotlin)">
81-
82-
```kotlin
83-
// https://mvnrepository.com/artifact/org.slf4j/slf4j-api
84-
implementation("org.slf4j:slf4j-api:2.0.16")
85-
```
86-
</TabItem>
87-
<TabItem value="gradle" label="Gradle">
88-
89-
```groovy
90-
// https://mvnrepository.com/artifact/org.slf4j/slf4j-api
91-
implementation 'org.slf4j:slf4j-api:2.0.16'
92-
```
93-
94-
</TabItem>
95-
</Tabs>
96-
9757
## Configuration
9858

9959
**Driver Class**: `com.clickhouse.jdbc.ClickHouseDriver`
10060

10161
**URL Syntax**: `jdbc:(ch|clickhouse)[:<protocol>]://endpoint1[,endpoint2,...][/<database>][?param1=value1&param2=value2][#tag1,tag2,...]`, for example:
10262

10363
- `jdbc:clickhouse:http://localhost:8123`
104-
- `jdbc:clickhouse:https://localhost:8443?ssl=true&sslmode=STRICT`
64+
- `jdbc:clickhouse:https://localhost:8443?ssl=true`
10565

10666
**Connection Properties**:
10767

10868
Beyond standard JDBC properties, the driver supports the ClickHouse-specific properties offered by the underlying [client](/docs/en/integrations/language-clients/java/client-v2.md).
10969
Where possible methods will return an SQLFeatureNotSupportedException if the feature is not supported. Other custom properties include:
11070

111-
| Property | Default | Description |
112-
|----------------------------------|---------|---------------------------------------------|
113-
| `disable_frameworks_detection` | `true` | Disable frameworks detection for User-Agent |
114-
| `jdbc_ignore_unsupported_values` | `false` | Suppresses SQLFeatureNotSupportedException |
115-
| `clickhouse.jdbc.v1` | `false` | Use JDBC-V1 instead of JDBC-V2 |
71+
| Property | Default | Description |
72+
|----------------------------------|---------|----------------------------------------------------------------|
73+
| `disable_frameworks_detection` | `true` | Disable frameworks detection for User-Agent |
74+
| `jdbc_ignore_unsupported_values` | `false` | Suppresses SQLFeatureNotSupportedException |
75+
| `clickhouse.jdbc.v1` | `false` | Use JDBC-V1 instead of JDBC-V2 |
76+
| `default_query_settings` | `null` | Allows passing of default query settings with query operations |
11677

11778
## Supported data types
11879

0 commit comments

Comments
 (0)