> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cloud.cdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Metabase

## Prerequisites

Before you connect Metabase to Connect AI, you must perform the following prerequisites.

In Connect AI:

* Connect a data source to your Connect AI account. See [Sources](/ja/Sources) for more information.
* Generate a Personal Access Token (PAT) on the [Settings](/ja/Settings#personal-access-tokens) page. Copy this down, as it acts as your password during authentication.

To use the Open Source version of Metabase with Connect AI, you need to have a Java Runtime Environment installed on your system. Metabase recommends version 11 of JRE. See the [Metabase Documentation](https://www.metabase.com/latest/installation-and-operation/running-the-metabase-jar-file) for details.

## Download and Install the Metabase JAR File

<Steps>
  <Step>
    [Download the Metabase OSS JAR file](https://www.metabase.com/start/oss/jar).
  </Step>

  <Step>
    Create a new directory and move `metabase.jar` to the new directory.
  </Step>

  <Step>
    In the new directory, run the JAR file:

    ```bash theme={null}
    java -jar metabase.jar
    ```

    Metabase logs its progress in the terminal as it starts up. Wait until you see the message `Metabase Initialization Complete` before you start Metabase.
  </Step>

  <Step>
    Visit `http://localhost:3000/setup` to start Metabase and complete your setup.

    <Frame>
      <img src="https://mintcdn.com/cdata/tJfdD354GT5ojxph/ja/images/metabase_client_welcome.png?fit=max&auto=format&n=tJfdD354GT5ojxph&q=85&s=ac4163659f90523657079b844382f9a7" alt="Metabase Client Welcome" width="758" height="449" data-path="ja/images/metabase_client_welcome.png" />
    </Frame>
  </Step>

  <Step>
    Follow the prompts to set up an admin account.
  </Step>
</Steps>

## Connect to Connect AI

Step 4 of the Metabase setup is adding your data. To connect to Connect AI, do the following:

<Steps>
  <Step>
    Click **SQL Server**.

    <Frame>
      <img src="https://mintcdn.com/cdata/tJfdD354GT5ojxph/ja/images/metabase_client_add_data.png?fit=max&auto=format&n=tJfdD354GT5ojxph&q=85&s=59318b4e2c7a178402d24992aff91154" alt="Metabase Client Add Data" width="731" height="613" data-path="ja/images/metabase_client_add_data.png" />
    </Frame>
  </Step>

  <Step>
    Enter the following information:

    * **Display name**—the name of your data for display purposes.
    * **Host**—*tds.cdata.com*
    * **Port**—*14333*
    * **Database name**—接続したいConnect AI データソースのConnection Name を入力します。例：*Salesforce1*
    * **Database Instance name**—N/A
    * **Username**—Connect AI のユーザー名を入力します。ユーザー名は、Connect AI の画面の右上に表示されています。例：*[test@cdata.co.jp](mailto:test@cdata.co.jp)*
    * **Password**—[Settings](/ja/Settings#personal-access-tokens) ページで生成したPAT を入力します。

    <Frame>
      <img src="https://mintcdn.com/cdata/tJfdD354GT5ojxph/ja/images/metabase_client_add_data_2.png?fit=max&auto=format&n=tJfdD354GT5ojxph&q=85&s=516697fc63a739ce9629e10178204842" alt="Metabase Client Add Data 2" width="821" height="1005" data-path="ja/images/metabase_client_add_data_2.png" />
    </Frame>

    Leave the rest of the connection settings at their default values unless you need to modify them. You can change the database details later in Metabase Admin.
  </Step>

  <Step>
    Click **Next**.
  </Step>

  <Step>
    Click **Take me to Metabase**.
  </Step>
</Steps>

## Query Your Data

<Steps>
  <Step>
    In the Home screen, click **New** > **SQL Query**.

    <Frame>
      <img src="https://mintcdn.com/cdata/tJfdD354GT5ojxph/ja/images/metabase_client_sql_query.png?fit=max&auto=format&n=tJfdD354GT5ojxph&q=85&s=ae25fe546cad691205995ae9fb590470" alt="Metabase Client SQL Query" width="1449" height="852" data-path="ja/images/metabase_client_sql_query.png" />
    </Frame>
  </Step>

  <Step>
    Select the database you just added.

    <Frame>
      <img src="https://mintcdn.com/cdata/tJfdD354GT5ojxph/ja/images/metabase_client_select_database.png?fit=max&auto=format&n=tJfdD354GT5ojxph&q=85&s=395ea9b6c7de7416a70964ed232de82b" alt="Metabase Client Select Database" width="432" height="364" data-path="ja/images/metabase_client_select_database.png" />
    </Frame>
  </Step>

  <Step>
    Create a SQL query for the data.

    <Frame>
      <img src="https://mintcdn.com/cdata/tJfdD354GT5ojxph/ja/images/metabase_client_query.png?fit=max&auto=format&n=tJfdD354GT5ojxph&q=85&s=eb3c41b597364fb0b540afa51af5581a" alt="Metabase Client Query" width="652" height="230" data-path="ja/images/metabase_client_query.png" />
    </Frame>
  </Step>

  <Step>
    Click **Run query** to retrieve your data.

    <Frame>
      <img src="https://mintcdn.com/cdata/tJfdD354GT5ojxph/ja/images/metabase_client_query_results.png?fit=max&auto=format&n=tJfdD354GT5ojxph&q=85&s=ddbb282b0d8104d125a0b533194e8d7b" alt="Metabase Client Query Results" width="1043" height="353" data-path="ja/images/metabase_client_query_results.png" />
    </Frame>
  </Step>

  <Step>
    Click **Save** to save your query and add it to your collection.
  </Step>
</Steps>
