## Module 1: Prepare the Environment

### Step 1. Open a terminal in IDE

+ Click [here](${LAB:HTTPS_REVERSE_PROXY_URL}?next=${LAB:"/vscode/?folder=/root/tidb-lab-java"|urlencode} "VS Code") to open the VS Code environment for this lab in a new browser window.

+ This operation may raises a prompt on your browser, saying `xx-xxx-xxx-xx.sslip.io wants to see text and images copied to the clipboard`. Please click `Allow`.

+ Click `Yes, I trust the authors` in the popup window.

  ![90%](https://pingcap-edu.s3.us-west-2.amazonaws.com/quick-demo/vscode-trust.jpg)

+ Click on `≡`, `Terminal`, then `New Terminal` to open a new terminal in the VS Code.

  ![90%](https://public-pingcap-innovation.s3.us-west-2.amazonaws.com/demo-405/405-open-terminal-0307.jpg)

### Step 2. Update the env.sh file

+ Find the `env.sh` file under folder `tidb-lab-java/`, update the TiDB Cloud Starter credentials, and save it.

  ```properties
  #!/bin/sh

  ## You only need to change this part
  export TIDB_HOST=${LAB:SERVERLESS_CLUSTER_HOST}
  export TIDB_PORT=${LAB:SERVERLESS_CLUSTER_PORT}
  export TIDB_USER='${LAB:SERVERLESS_CLUSTER_USERNAME}'
  export TIDB_PASSWORD='${LAB:SERVERLESS_CLUSTER_PASSWORD}'
  export TIDB_DB_NAME=${LAB:SERVERLESS_CLUSTER_DATABASE_NAME}
  export USE_SSL='true'

  ## Do not change the following part
  jdbc_url="jdbc:mysql://${TIDB_HOST}:${TIDB_PORT}/${TIDB_DB_NAME}"
  if [ 'true' = "${USE_SSL}" ]; then
    jdbc_url="${jdbc_url}?sslMode=VERIFY_IDENTITY&enabledTLSProtocols=TLSv1.2,TLSv1.3"
  fi

  export TIDB_JDBC_URL=${jdbc_url}
  ```

+ Source the `env.sh` file in the terminal.

  ```bash
  source env.sh
  ```

+ Validate the environment settings

  ```bash
  echo $TIDB_USER
  ```

  ```output
  '${LAB:SERVERLESS_CLUSTER_USERNAME}'
  ```

  ```bash
  echo $TIDB_PASSWORD
  ```

  ```output
  '${LAB:SERVERLESS_CLUSTER_PASSWORD}'
  ```
