Skip to content

Commit a892a45

Browse files
committed
Update readme and client example
1 parent 2562606 commit a892a45

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

README.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@ Java libraries for connecting to ClickHouse and processing data in various forma
4444
| Transaction | Transaction | :white_check_mark: | supported since 0.3.2-patch11, use ClickHouse 22.7+ for native implicit transaction support |
4545
| | Savepoint | :x: | |
4646
| | XAConnection | :x: | |
47-
| Misc. | Implicit Type Conversion | :white_check_mark: | String/number to Date/Time/Timestamp and more |
48-
| | Centralized Configuration | :white_check_mark: | supported since 0.4.2, custom server setting `custom_jdbc_config` for all connected JDBC clients |
47+
| Misc. | Centralized Configuration | :white_check_mark: | supported since 0.4.2, limited to JDBC driver and requires custom server setting `custom_jdbc_config` for all connected JDBC clients - [#1290](/ClickHouse/clickhouse-java/pull/1290) |
48+
| | INFILE & OUTFILE | :white_check_mark: | supported since 0.4.2, limited to JDBC driver and requires `localFile` option - [#1291](/ClickHouse/clickhouse-java/pull/1291) |
49+
| | Implicit Type Conversion | :white_check_mark: | String/number to Date/Time/Timestamp and more |
4950

5051
## Usage
5152

@@ -63,11 +64,11 @@ The library can be downloaded from both [Github Releases](../../releases) and [M
6364

6465
### Java Client
6566

66-
See the [client docs on the ClickHouse website](https://clickhouse.com/docs/en/integrations/language-clients/java/client).
67+
See [examples](../../tree/main/examples/client) and the [docs on the ClickHouse website](https://clickhouse.com/docs/en/integrations/language-clients/java/client).
6768

6869
### JDBC Driver
6970

70-
See the [jdbc driver docs on the ClickHouse website](https://clickhouse.com/docs/en/integrations/language-clients/java/jdbc).
71+
See [examples](../../tree/main/examples/jdbc) and the [docs on the ClickHouse website](https://clickhouse.com/docs/en/integrations/language-clients/java/jdbc).
7172

7273
## Contributing
7374

examples/client/src/main/java/com/clickhouse/examples/jdbc/Main.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,11 @@ static long insert(ClickHouseNode server, String table) throws ClickHouseExcepti
7171

7272
static int query(ClickHouseNode server, String table) throws ClickHouseException {
7373
try (ClickHouseClient client = ClickHouseClient.newInstance(server.getProtocol());
74-
ClickHouseResponse response = client.connect(server).query("select * from " + table).execute().get()) {
74+
ClickHouseResponse response = client.read(server)
75+
// prefer to use RowBinaryWithNamesAndTypes as it's fully supported
76+
// see details at https://github.com/ClickHouse/clickhouse-java/issues/928
77+
.format(ClickHouseFormat.RowBinaryWithNamesAndTypes)
78+
.query("select * from " + table).execute().get()) {
7579
int count = 0;
7680
// or use stream API via response.stream()
7781
for (ClickHouseRecord r : response.records()) {

0 commit comments

Comments
 (0)