---
metadata:
  - name: generator
    content: Diplodoc Platform v5.52.0
alternate:
  - https://ydb.tech/docs/en/reference/languages-and-apis/jdbc-driver/properties.md
  - https://ydb.tech/docs/ru/reference/languages-and-apis/jdbc-driver/properties.md
  - href: en/reference/languages-and-apis/jdbc-driver/properties.md
    type: text/markdown
    title: Markdown version
  - href: ../../../llms.txt
    type: text/markdown
    title: llms.txt
sourcePath: en/core/reference/languages-and-apis/jdbc-driver/properties.md
---
> **Documentation Index:** Fetch the complete configuration index at https://ydb.tech/docs/en/llms.txt

# JDBC driver properties

The JDBC driver for YDB supports the following configuration properties, which can be specified in the [JDBC URL](#jdbc-url-examples) or passed via additional properties:

* `saFile` — service account key for authentication. The valid value is either the content of the JSON file or a file reference. {#saFile}

* `iamEndpoint` — custom IAM endpoint for authentication using a service account key.

* `token` — token value for authentication. The valid value is either the token content or a token file reference. {#token}

* `useMetadata` — indicates whether to use metadata authentication. Valid values are: {#useMetadata}

    - `true` — use metadata authentication.
    - `false` — do not use metadata authentication.

    Default value: `false`.

* `metadataURL` — custom metadata endpoint.

* `localDatacenter` — the name of the data center local to the application being connected.

* `secureConnection` — indicates whether to use TLS. Valid values are:

    - `true` — enforce TLS.
    - `false` — do not enforce TLS.

    The primary way to indicate whether a connection is secure or not is by using the `grpcs://` scheme for secure connections and `grpc://` for insecure connections in the JDBC URL. This property allows overriding it.

* `secureConnectionCertificate` — custom CA certificate for TLS connections. The valid value is either the certificate content or a certificate file reference.

{% note info %}

File references for `saFile`, `token`, or `secureConnectionCertificate` must be prefixed with the `file:` URL scheme, for example:

* `saFile=file:~/mysakey1.json`
* `token=file:/opt/secret/token-file`
* `secureConnectionCertificate=file:/etc/ssl/cacert.cer`

{% endnote %}

## Using the QueryService mode

By default, the JDBC driver currently uses a legacy API for running queries to be compatible with a broader range of YDB versions. However, that API has some extra [limitations](https://ydb.tech/docs/en/concepts/limits-ydb.md#query). To turn off this behavior and use a modern API called "Query Service", add the `useQueryService=true` property to the JDBC URL.

## JDBC URL examples {#jdbc-url-examples}

<!-- source: en/reference/languages-and-apis/jdbc-driver/_includes/jdbc-url-examples.md -->
- Local Docker container with anonymous authentication and without TLS:<br/>`jdbc:ydb:grpc://localhost:2136/local`
- Remote self-hosted cluster:<br/>`jdbc:ydb:grpcs://<host>:2135/Root/<testdb>?secureConnectionCertificate=file:~/<myca>.cer`
- A cloud database instance with a token:<br/>`jdbc:ydb:grpcs://<host>:2135/<path/to/database>?token=file:~/my_token`
- A cloud database instance with a service account:<br/>`jdbc:ydb:grpcs://<host>:2135/<path/to/database>?saFile=file:~/sa_key.json`
<!-- endsource: en/reference/languages-and-apis/jdbc-driver/_includes/jdbc-url-examples.md -->