Java Client

|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Method Arguments Description Default Key|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | `setSSLTrustStore(String path)` `path` - file path on local system Sets if client should use SSL truststore for server host validation. - `trust_store`| `setSSLTrustStorePassword(String password)` `password` - secret value Sets password to be used to unlock SSL truststore specified by `setSSLTrustStore` - `key_store_password`| `setSSLTrustStoreType(String type)` `type` - truststore type name Sets type of the truststore specified by `setSSLTrustStore`. - `key_store_type`| `setRootCertificate(String path)` `path` - file path on local system Sets if client should use specified root (CA) certificate for server host to validation. - `sslrootcert`| `setClientCertificate(String path)` `path` - file path on local system Sets client certificate path to be used while initiating SSL connection and to be used by SSL authentication. - `sslcert`| `setClientKey(String path)` `path` - file path on local system Sets client private key to be used for encrypting SSL communication with a server. - `ssl_key`| `sslSocketSNI(String sni)` `sni` - server name string Sets server name to be used for SNI (Server Name Indication) in SSL/TLS connection. - `ssl_socket_sni` | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |

|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Method Arguments Description Default Key|  |  |  |  |  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | `addProxy(ProxyType type, String host, int port)` `type` - proxy type `host` - proxy hostname or IP `port` - proxy port Sets proxy to be used for communication with a server. - `proxy_type`, `proxy_host`, `proxy_port`| `setProxyCredentials(String user, String pass)` `user` - proxy username `pass` - password Sets user credentials to authenticate with a proxy. - `proxy_user`, `proxy_password` | | | | | | | | | | | | | | |

|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Method Arguments Description Default Key|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | `setHttpCookiesEnabled(boolean enabled)` `enabled` - flag to enable/disable Set if HTTP cookies should be remembered and sent to server back. - -|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | `httpHeader(String key, String value)` `key` - HTTP header key `value` - string value Sets value for a single HTTP header. Previous value is overridden. `none` `none`| `httpHeader(String key, Collection values)` `key` - HTTP header key `values` - list of string values Sets values for a single HTTP header. Previous value is overridden. `none` `none`| `httpHeaders(Map headers)` `headers` - map with HTTP headers Sets multiple HTTP header values at a time. `none` `none`| `useHttpFormDataForQuery(boolean enable)` `enable` - flag to enable/disable Sets whether query parameters should be sent as HTTP form data in the request body instead of the URL. Works only with server-side compression. If client-level compression is enabled, it will be disabled for query requests with parameters, as each parameter is sent as multipart content. `false` `client.http.use_form_request_for_query` | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |

|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Method Arguments Description Default Key|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | `serverSetting(String name, String value)` `name` - setting name `value` - setting value Sets what settings to pass to server along with each query. Individual operation settings may override it. [List of settings](/docs/operations/settings/query-level) `none` `none`| `serverSetting(String name, Collection values)` `name` - setting name `values` - setting values Sets what settings to pass to server with multiple values, for example [roles](/docs/interfaces/http#setting-role-with-query-parameters) `none` `none`| `setOption("custom_settings_prefix", value)` `value` - prefix string Sets the prefix for custom settings passed to the server. Should be aligned with the server configuration. See [ClickHouse Docs](/docs/operations/settings/query-level#custom_settings). `custom_` `custom_settings_prefix` | | | | | | | | | | | | | | | | | | | |

|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Method Arguments Description Default Key|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | `useServerTimeZone(boolean useServerTimeZone)` `useServerTimeZone` - flag to enable/disable Sets if client should use server timezone when decoding DateTime and Date column values. `true` `use_server_time_zone`| `useTimeZone(String timeZone)` `timeZone` - java valid timezone ID Sets if specified timezone should be used when decoding DateTime and Date column values. Will override server timezone. - `use_time_zone`| `setServerTimeZone(String timeZone)` `timeZone` - java valid timezone ID Sets server side timezone. UTC timezone will be used by default. `UTC` `server_time_zone` | | | | | | | | | | | | | | | | | | | |