Skip to content

Commit

Permalink
[DOC-9718] Update Spring JPA and JDBC app tutorials for Cloud 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mdlinville committed Sep 12, 2024
1 parent 4c80e8e commit cae9ccd
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{% include_cached copy-clipboard.html %}
~~~ shell
cockroach sql --url 'postgresql://<username>:<password>@<serverless-host>:26257/defaultdb?sslmode=verify-full&sslrootcert='$HOME'/.postgresql/root.crt'
cockroach sql --url 'postgresql://<username>:<password>@<cluster-host>:26257/defaultdb?sslmode=verify-full&sslrootcert='$HOME'/.postgresql/root.crt'
~~~

</section>
Expand All @@ -11,7 +11,7 @@

{% include_cached copy-clipboard.html %}
~~~ shell
cockroach sql --url 'postgresql://<username>:<password>@<serverless-host>:26257/defaultdb?sslmode=verify-full&sslrootcert='$HOME'/.postgresql/root.crt'
cockroach sql --url 'postgresql://<username>:<password>@<cluster-host>:26257/defaultdb?sslmode=verify-full&sslrootcert='$HOME'/.postgresql/root.crt'
~~~

</section>
Expand All @@ -20,15 +20,15 @@

{% include_cached copy-clipboard.html %}
~~~ shell
cockroach sql --url "postgresql://<username>:<password>@<serverless-host>:26257/defaultdb?sslmode=verify-full&sslrootcert=$env:appdata/.postgresql/root.crt"
cockroach sql --url "postgresql://<username>:<password>@<cluster-host>:26257/defaultdb?sslmode=verify-full&sslrootcert=$env:appdata/.postgresql/root.crt"
~~~

</section>

Where:
- `<username>` is the SQL user. By default, this is your CockroachDB {{ site.data.products.cloud }} account username.
- `<password>` is the password for the SQL user. The password will be shown only once in the **Connection info** dialog after creating the cluster.
- `<serverless-host>` is the hostname of the CockroachDB {{ site.data.products.serverless }} cluster.
- `<cluster-hostname>` is the hostname of your CockroachDB {{ site.data.products.cloud }} cluster.
- `<cluster-id>` is a unique string used to identify your cluster when downloading the CA certificate. For example, `12a3bcde-4fa5-6789-1234-56bc7890d123`.

You can find these settings in the **Connection parameters** tab of the **Connection info** dialog.
You can find these settings in the **Connection parameters** tab of the **Connection info** dialog.
10 changes: 5 additions & 5 deletions src/current/v24.2/build-a-spring-app-with-cockroachdb-jdbc.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ This tutorial assumes you are running under [`SERIALIZABLE`]({% link {{ page.ver

## Step 1. Start CockroachDB

Choose whether to run a local cluster or a free CockroachDB {{ site.data.products.cloud }} cluster.
Choose whether to run a local cluster or a free CockroachDB {{ site.data.products.standard }} cluster.

<div class="filters clearfix">
<button class="filter-button page-level" data-scope="cockroachcloud">Use CockroachDB {{ site.data.products.standard }}</button>
Expand All @@ -39,7 +39,7 @@ Choose whether to run a local cluster or a free CockroachDB {{ site.data.product

### Set up your cluster connection

{% include cockroachcloud/quickstart/set-up-your-cluster-connection.md %}
{% include_cached cockroachcloud/quickstart/set-up-your-cluster-connection.md %}

</section>

Expand Down Expand Up @@ -92,13 +92,13 @@ The [`--also-generate-pkcs8-key` flag]({% link {{ page.version.version }}/cockro

<section class="filter-content" markdown="1" data-scope="cockroachcloud">

1. If you haven't already, [download the CockroachDB binary]({% link {{ page.version.version }}/install-cockroachdb.md %}).
1. If you haven't already, [download the CockroachDB SQL Shell binary]({% link {{ page.version.version }}/install-cockroachdb.md %}).
1. Start the [built-in SQL shell]({% link {{ page.version.version }}/cockroach-sql.md %}) using the connection string you got from the CockroachDB {{ site.data.products.cloud }} Console [earlier](#set-up-your-cluster-connection):

{% include_cached copy-clipboard.html %}
~~~ shell
$ cockroach sql \
--url 'postgresql://<user>@<cluster-name>-<short-id>.<region>.<host>:26257/<database>?sslmode=verify-full&sslrootcert='$HOME'/Library/CockroachCloud/certs/<cluster-name>-ca.crt'
--url 'postgresql://<user>@<cluster-host>-<short-id>.<region>.<host>:26257/<database>?sslmode=verify-full&sslrootcert='$HOME'/Library/CockroachCloud/certs/<cluster-name>-ca.crt'
~~~

1. Enter your SQL user password.
Expand Down Expand Up @@ -211,7 +211,7 @@ Where:
~~~ yml
...
datasource:
url: jdbc:postgresql://{globalhost}:{port}/{cluster_name}.roach_data?sslmode=verify-full&sslrootcert={path to the CA certificate}/cc-ca.crt
url: jdbc:postgresql://{globalhost}:{port}/{cluster_host}.roach_data?sslmode=verify-full&sslrootcert={path to the CA certificate}/cc-ca.crt
username: {username}
password: {password}
driver-class-name: org.postgresql.Driver
Expand Down
10 changes: 5 additions & 5 deletions src/current/v24.2/build-a-spring-app-with-cockroachdb-jpa.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This tutorial shows you how to build a [Spring Boot](https://spring.io/projects/

## Step 1. Start CockroachDB

Choose whether to run a local cluster or a free CockroachDB {{ site.data.products.cloud }} cluster.
Choose whether to run a local cluster or a free CockroachDB {{ site.data.products.standard }} cluster.

<div class="filters clearfix">
<button class="filter-button page-level" data-scope="cockroachcloud">Use CockroachDB {{ site.data.products.standard }}</button>
Expand All @@ -35,7 +35,7 @@ Choose whether to run a local cluster or a free CockroachDB {{ site.data.product

### Set up your cluster connection

{% include cockroachcloud/quickstart/set-up-your-cluster-connection.md %}
{% include_cached cockroachcloud/quickstart/set-up-your-cluster-connection.md %}

</section>

Expand Down Expand Up @@ -88,13 +88,13 @@ The [`--also-generate-pkcs8-key` flag]({% link {{ page.version.version }}/cockro

<section class="filter-content" markdown="1" data-scope="cockroachcloud">

1. If you haven't already, [download the CockroachDB binary]({% link {{ page.version.version }}/install-cockroachdb.md %}).
1. If you haven't already, [download the CockroachDB SQL Shell binary]({% link {{ page.version.version }}/install-cockroachdb.md %}).
1. Start the [built-in SQL shell]({% link {{ page.version.version }}/cockroach-sql.md %}) using the connection string you got from the CockroachDB {{ site.data.products.cloud }} Console [earlier](#set-up-your-cluster-connection):

{% include_cached copy-clipboard.html %}
~~~ shell
$ cockroach sql \
--url='postgres://{username}:{password}@{global host}:26257/{cluster_name}.defaultdb?sslmode=verify-full&sslrootcert={certs_dir}/cc-ca.crt'
--url='postgres://{username}:{password}@{global host}:26257/{cluster_host}.defaultdb?sslmode=verify-full&sslrootcert={certs_dir}/cc-ca.crt'
~~~

In the connection string copied from the CockroachDB {{ site.data.products.cloud }} Console, your username, password and cluster name are pre-populated. Replace the `{certs_dir}` placeholder with the path to the `certs` directory that you created [earlier](#set-up-your-cluster-connection).
Expand Down Expand Up @@ -217,7 +217,7 @@ Where:
~~~ yml
...
datasource:
url: jdbc:postgresql://{globalhost}:{port}/{cluster_name}.roach_data?sslmode=verify-full&sslrootcert={path to the CA certificate}/cc-ca.crt
url: jdbc:postgresql://{globalhost}:{port}/{cluster_host}.roach_data?sslmode=verify-full&sslrootcert={path to the CA certificate}/cc-ca.crt
username: {username}
password: {password}
driver-class-name: org.postgresql.Driver
Expand Down
2 changes: 1 addition & 1 deletion src/current/v24.2/deploy-app-vercel.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Before starting the tutorial, create a [Vercel](https://vercel.com/signup) accou

{% include_cached cockroachcloud/connection-string-standard.md %}

# Step 2. Get the code
## Step 2. Get the code

1. Open the code repository's [GitHub repository](https://github.com/cockroachdb/prisma-examples).
1. Fork it by clicking **Fork** at the top. Netlify requires you to own a Netlify app's repository.
Expand Down

0 comments on commit cae9ccd

Please sign in to comment.