Connecting to YDB with DBeaver
DBeaver is a free, cross-platform, open-source database management tool that provides a visual interface for connecting to various databases and executing SQL queries. It supports many database management systems, including MySQL, PostgreSQL, Oracle, and SQLite.
DBeaver allows you to work with YDB using the Java DataBase Connectivity (JDBC) protocol. This article demonstrates how to set up this integration.
Connecting the YDB JDBC Driver to DBeaver
To connect to YDB from DBeaver, you will need the JDBC driver. Follow these steps to download the JDBC driver:
- Go to the ydb-jdbc-driver repository.
- Select the latest release (tagged as
Latest
) and save theydb-jdbc-driver-shaded-<driver-version>.jar
file.
Follow these steps to connect the downloaded JDBC driver:
-
In the top menu of DBeaver, select the Database option, then select Driver Manager:
-
To create a new driver, click the New button in the Driver Manager window that opens
-
In the Create Driver window that opens, specify
YDB
in the Driver Name field: -
Go to the Libraries section, click Add File, specify the path to the previously downloaded YDB JDBC driver (the
ydb-jdbc-driver-shaded-<driver-version>.jar
file), and click OK: -
The YDB item will appear in the list of drivers. Double-click the new driver and go to the Libraries tab, click Find Class, and select
tech.ydb.jdbc.YdbDriver
from the dropdown list.Warning
Be sure to explicitly select the
tech.ydb.jdbc.YdbDriver
item from the dropdown list by clicking on it. Otherwise, DBeaver will consider that the driver has not been selected.
Creating a Connection to YDB
Perform the following steps to establish a connection:
-
In DBeaver, create a new connection, specifying the
YDB
connection type. -
In the window that opens, go to the Main section.
-
In the General subsection, in the JDBC URL input field, specify the following connection string:
jdbc:ydb:<ydb_endpoint>/<ydb_database>?useQueryService=true
Where:
-
In the User and Password fields, enter the login and password for connecting to the database. A complete list of authentication methods and connection strings for YDB is provided in the JDBC driver description.
-
Click Test Connection... to verify the settings.
If all settings are correct, a message indicating successful connection testing will appear:
-
Click Finish to save the connection.
Working with YDB
With DBeaver, you can view the list and structure of tables:
As well as execute queries on the data: