Skip to content

Commit

Permalink
Merge branch 'main' into rfc-dr
Browse files Browse the repository at this point in the history
  • Loading branch information
soyeric128 authored Jan 9, 2025
2 parents 869286c + d96cfb6 commit 4fd7d44
Show file tree
Hide file tree
Showing 15 changed files with 61 additions and 73 deletions.
2 changes: 1 addition & 1 deletion docs/en/guides/30-sql-clients/01-jdbc/_category_.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"label": "SQL Clients"
"label": "DBeaver"
}
41 changes: 3 additions & 38 deletions docs/en/guides/30-sql-clients/01-jdbc/index.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,10 @@
---
title: Connecting to Databend with SQL Clients
sidebar_label: SQL Clients
title: DBeaver
---

Databend provides a [JDBC driver](https://github.com/databendcloud/databend-jdbc) that enables connection to Databend from a client application, such as [DBeaver](https://dbeaver.com/). DBeaver comes with numerous pre-configured drivers for SQL, NoSQL, key-value databases, graph databases, search engines, and more. However, the Databend JDBC driver is not currently pre-configured in DBeaver, which means that you cannot locate and select Databend while creating a connection in the application. Nevertheless, you can manually add the driver to DBeaver, allowing you to establish a connection to Databend in the same way you would with a pre-configured database.
[DBeaver](https://dbeaver.com/) supports connecting to Databend using a built-in driver categorized under **Analytical**, available starting from **version 24.3.1**.

## Adding Databend JDBC Driver to DBeaver

Follow these steps to add the Databend JDBC driver to DBeaver:

1. In DBeaver, select **Database** > **Driver Manager** to open the Driver Manager, then click **New** to create a new driver.

2. On the **Settings** tab, enter the required information for the new driver as follows:

| Setting | Databend | Databend Cloud |
| ------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| Driver Name | databend | databendcloud |
| Driver Type | Generic | Generic |
| Class Name | com.databend.jdbc.DatabendDriver | com.databend.jdbc.DatabendDriver |
| URL Template | `jdbc:databend://{user}:{password}@{host}:{port}/{database}` | `jdbc:databend://{user}:{password}@{host}:{port}/{database}` |
| Default Port | 8000 | 443 |
| Default User | root | cloudapp |

![Alt text](/img/integration/jdbc-new-driver.png)
![Alt text](@site/static/img/documents/develop/jdbc-new-driver.png)

3. On the **Libraries** tab, click **Add Artifact**, then copy and paste the following to the **Dependency Declaration** textbox:

:::tip Check for and Update to New Version
Databend recommends updating to the latest version of the Databend JDBC driver to access the latest features and enhancements, and to resolve any issues you may encounter. Please check for available updates at ​https://github.com/databendcloud/databend-jdbc/releases and install the latest version.
:::

```java
<dependency>
<groupId>com.databend</groupId>
<artifactId>databend-jdbc</artifactId>
<version>0.3.4</version>
</dependency>
```

4. Click **OK** to close the windows.
![](@site/static/img/connect/dbeaver.png)

## User Authentication

Expand Down
4 changes: 1 addition & 3 deletions docs/en/guides/30-sql-clients/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ title: Connect to Databend
---
import IndexOverviewList from '@site/src/components/IndexOverviewList';

To connect effortlessly to a self-hosted Databend instance or Databend Cloud, BendSQL is recommended. It offers a user-friendly experience, streamlining the connection process.

Alternatively, you can leverage Databend's JDBC driver to connect with other SQL clients. Explore the following links to get started:
This guide outlines various methods to connect to Databend:

<IndexOverviewList />
47 changes: 31 additions & 16 deletions docs/en/tutorials/connect/connect-to-databend-dbeaver.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,53 @@ sidebar_label: "Connecting to Self-Hosted Databend (DBeaver)"
import StepsWrap from '@site/src/components/StepsWrap';
import StepContent from '@site/src/components/Steps/step-content';

In this tutorial, we will guide you through the process of connecting to a self-hosted Databend instance through the Databend JDBC driver as the user `root`.
In this tutorial, we will guide you through the process of connecting to a self-hosted Databend instance using DBeaver.

<StepsWrap>
<StepContent number="1">

### Before You Start

- Ensure that you have a local Databend instance ready for testing. See [Docker and Local Deployments](/guides/deploy/deploy/non-production/deploying-local) for detailed instructions.
- In this tutorial, you will use the `root` account to connect to Databend. During deployment, uncomment the following lines in the [databend-query.toml](https://github.com/databendlabs/databend/blob/main/scripts/distribution/configs/databend-query.toml) configuration file to select this account:
- Ensure that [Docker](https://www.docker.com/) is installed on your local machine, as it will be used to launch Databend.
- Verify that DBeaver 24.3.1 or a later version is installed on your local machine.

```sql title="databend-query.toml"
[[query.users]]
name = "root"
auth_type = "no_password"
```
</StepContent>
<StepContent number="2">

### Start Databend

Run the following command in your terminal to launch a Databend instance:

:::note
If no custom values for `QUERY_DEFAULT_USER` or `QUERY_DEFAULT_PASSWORD` are specified when starting the container, a default `root` user will be created with no password.
:::

- Ensure you have added the Databend JDBC driver to your DBeaver. See [Adding Databend JDBC Driver to DBeaver](/guides/sql-clients/jdbc/#adding-databend-jdbc-driver-to-dbeaver) for detailed instructions.
```bash
docker run -d --name databend \
-p 3307:3307 -p 8000:8000 -p 8124:8124 -p 8900:8900 \
datafuselabs/databend:nightly
```

</StepContent>
<StepContent number="2">
<StepContent number="3">

### Set up Connection

1. In DBeaver, go to **Database** > **New Database Connection** to open the connection wizard, then select **Databend** under the **Analytical** category.

![alt text](@site/static/img/connect/dbeaver-analytical.png)

### Create Connection
2. Enter `root` for the **Username**.

1. In DBeaver, search for and select `databend` on **Database** > **New Database Connection** first, and then click **Next**.
![alt text](@site/static/img/connect/dbeaver-user-root.png)

![Alt text](/img/integration/jdbc-new-driver.png)
3. Click **Test Connection** to verify the connection. If this is your first time connecting to Databend, you will be prompted to download the driver. Click **Download** to proceed.

2. Configure your connection settings if needed. The default settings connect to a local instance of Databend as the user `root`.
![alt text](@site/static/img/connect/dbeaver-download-driver.png)

![Alt text](/img/integration/jdbc-connect.png)
Once the download is complete, the test connection should succeed, as shown below:

3. Click **Test Connection** to check if the connection is successful.
![alt text](../../../../static/img/connect/dbeaver-success.png)

</StepContent>
</StepsWrap>
40 changes: 25 additions & 15 deletions docs/en/tutorials/connect/connect-to-databendcloud-dbeaver.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,48 @@ sidebar_label: 'Connecting to Databend Cloud (DBeaver)'
import StepsWrap from '@site/src/components/StepsWrap';
import StepContent from '@site/src/components/Steps/step-content';

In this tutorial, we will guide you through the process of connecting to Databend Cloud through the Databend JDBC driver.
In this tutorial, we will guide you through the process of connecting to Databend Cloud using DBeaver.

<StepsWrap>
<StepContent number="1">

### Before You Start

- Ensure you have added the Databend JDBC driver to your DBeaver. See [Adding Databend JDBC Driver to DBeaver](/guides/sql-clients/jdbc/#adding-databend-jdbc-driver-to-dbeaver) for detailed instructions.
- Ensure that you already have a Databend Cloud account and can log in successfully.
- Verify that DBeaver 24.3.1 or a later version is installed on your local machine.

</StepContent>
<StepContent number="2">

### Create Connection
### Obtain Connection Information

Before creating a connection to Databend Cloud, you need to log in to Databend Cloud to obtain connection information. For more information, see [Connecting to a Warehouse](/guides/cloud/using-databend-cloud/warehouses#connecting).
Before creating a connection to Databend Cloud, you need to log in to Databend Cloud to obtain connection information. For more information, see [Connecting to a Warehouse](/guides/cloud/using-databend-cloud/warehouses#connecting). In this tutorial, we will use the following connection information:

1. In DBeaver, search for and select `databendcloud` on **Database** > **New Database Connection** first, and then click **Next**.
![alt text](@site/static/img/connect/dbeaver-connect-info.png)

![Alt text](@site/static/img/documents/develop/jdbc-select-driver.png)
</StepContent>
<StepContent number="3">

### Set up Connection

1. In DBeaver, go to **Database** > **New Database Connection** to open the connection wizard, then select **Databend** under the **Analytical** category.

![alt text](@site/static/img/connect/dbeaver-analytical.png)

2. In the **Main** tab, enter the **Host**, **Port**, **Username**, and **Password** based on the connection information obtained in the previous step.

![alt text](@site/static/img/connect/dbeaver-main-tab.png)

3. In the **Driver properties** tab, enter the **Warehouse** name based on the connection information obtained in the previous step.

![alt text](@site/static/img/connect/dbeaver-driver-properties.png)

2. Configure your connection settings.
4. In the **SSL** tab, select the **Use SSL** checkbox.

| Setting | Value |
|-----------------|-----------------------------------------------------------------------------------------|
| Host | Copy and paste your host address obtained from Databend Cloud, starting with `https://` |
| Password | Copy and paste your password generated from Databend Cloud |
| Database/Schema | For example, `default` |
![alt text](@site/static/img/connect/dbeaver-use-ssl.png)

![Alt text](@site/static/img/documents/develop/jdbc-connect.png)
5. Click **Test Connection** to verify the connection. If this is your first time connecting to Databend, you will be prompted to download the driver. Click **Download** to proceed. Once the download is complete, the test connection should succeed, as shown below:

3. Click **Test Connection** to check if the connection is successful.
![alt text](@site/static/img/connect/dbeaver-cloud-success.png)

</StepContent>
</StepsWrap>
Binary file added static/img/connect/dbeaver-analytical.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/connect/dbeaver-cloud-success.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/connect/dbeaver-connect-info.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/connect/dbeaver-download-driver.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/connect/dbeaver-driver-properties.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/connect/dbeaver-main-tab.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/connect/dbeaver-success.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/connect/dbeaver-use-ssl.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/connect/dbeaver-user-root.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/connect/dbeaver.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4fd7d44

Please sign in to comment.