Skip to content

Commit af72ea6

Browse files
author
Eric Harmeling
committed
Updated version guidance on Java docs
1 parent 17870b9 commit af72ea6

21 files changed

+55
-48
lines changed

_includes/v19.2/app/BasicExample.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public static void main(String[] args) {
3939
ds.setPassword(null);
4040
ds.setSsl(true);
4141
ds.setSslMode("require");
42+
ds.setSslRootCert("certs/client.root.crt");
4243
ds.setSslCert("certs/client.maxroach.crt");
4344
ds.setSslKey("certs/client.maxroach.key.pk8");
4445
ds.setReWriteBatchedInserts(true); // add `rewriteBatchedInserts=true` to pg connection string
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{{site.data.alerts.callout_info}}
2+
We recommend using Java versions 8+ with CockroachDB.
3+
{{site.data.alerts.end}}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
We recommend using the latest PostgreSQL JDBC 4.2 driver. All 4.2 versions of the driver are compatible with Java versions 8+.

_includes/v20.1/app/BasicExample.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public static void main(String[] args) {
3939
ds.setPassword(null);
4040
ds.setSsl(true);
4141
ds.setSslMode("require");
42+
ds.setSslRootCert("certs/client.root.crt");
4243
ds.setSslCert("certs/client.maxroach.crt");
4344
ds.setSslKey("certs/client.maxroach.key.pk8");
4445
ds.setReWriteBatchedInserts(true); // add `rewriteBatchedInserts=true` to pg connection string
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{{site.data.alerts.callout_info}}
2+
We recommend using Java versions 8+ with CockroachDB.
3+
{{site.data.alerts.end}}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
We recommend using the latest PostgreSQL JDBC 4.2 driver. All 4.2 versions of the driver are compatible with Java versions 8+.

_includes/v20.2/app/BasicExample.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public static void main(String[] args) {
3939
ds.setPassword(null);
4040
ds.setSsl(true);
4141
ds.setSslMode("require");
42+
ds.setSslRootCert("certs/client.root.crt");
4243
ds.setSslCert("certs/client.maxroach.crt");
4344
ds.setSslKey("certs/client.maxroach.key.pk8");
4445
ds.setReWriteBatchedInserts(true); // add `rewriteBatchedInserts=true` to pg connection string
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{{site.data.alerts.callout_info}}
2+
We recommend using Java versions 8+ with CockroachDB.
3+
{{site.data.alerts.end}}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
We recommend using the latest PostgreSQL JDBC 4.2 driver. All 4.2 versions of the driver are compatible with Java versions 8+.

v19.2/build-a-java-app-with-cockroachdb-hibernate.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ twitter: false
1313

1414
This tutorial shows you how build a simple Java application with CockroachDB and the Hibernate ORM.
1515

16+
{% include {{page.version.version}}/app/java-version-note.md %}
17+
1618
{{site.data.alerts.callout_success}}
1719
For another use of Hibernate with CockroachDB, see our [`examples-orms`](https://github.com/cockroachdb/examples-orms) repository.
1820
{{site.data.alerts.end}}
@@ -21,10 +23,6 @@ For another use of Hibernate with CockroachDB, see our [`examples-orms`](https:/
2123

2224
{% include {{page.version.version}}/app/before-you-begin.md %}
2325

24-
{{site.data.alerts.callout_danger}}
25-
The examples on this page assume you are using a Java version <= 9. They do not work with Java 10.
26-
{{site.data.alerts.end}}
27-
2826
## Step 1. Install the Gradle build tool
2927

3028
This tutorial uses the [Gradle build tool](https://gradle.org/) to get all dependencies for your application, including Hibernate.

v19.2/build-a-java-app-with-cockroachdb-jooq.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ This tutorial shows you how build a simple Java application with CockroachDB and
1515

1616
CockroachDB is supported in jOOQ [Professional and Enterprise editions](https://www.jooq.org/download/#databases).
1717

18+
{% include {{page.version.version}}/app/java-version-note.md %}
19+
1820
{{site.data.alerts.callout_success}}
1921
For another use of jOOQ with CockroachDB, see our [`examples-orms`](https://github.com/cockroachdb/examples-orms) repository.
2022
{{site.data.alerts.end}}
@@ -47,10 +49,6 @@ For other ways to install Maven, see [its official documentation](https://maven.
4749

4850
Download the free trial of jOOQ Professional or Enterprise edition from [jOOQ's website](https://www.jooq.org/download), and unzip the file.
4951

50-
{{site.data.alerts.callout_info}}
51-
If you have Java 6, Java 8, or Java 11, go to [Download your jOOQ version](https://www.jooq.org/download/versions#trial), and download the free trial of jOOQ for your version of Java.
52-
{{site.data.alerts.end}}
53-
5452
To install jOOQ to your machine's local Maven repository, run the `maven-install.sh` script included in the jOOQ install folder:
5553

5654
{% include copy-clipboard.html %}

v19.2/build-a-java-app-with-cockroachdb.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@ twitter: false
1313

1414
This tutorial shows you how to build a simple Java application with CockroachDB and the Java JDBC driver.
1515

16+
{% include {{page.version.version}}/app/java-version-note.md %}
17+
1618
## Before you begin
1719

1820
{% include {{page.version.version}}/app/before-you-begin.md %}
1921

20-
{{site.data.alerts.callout_danger}}
21-
The examples on this page assume you are using a Java version <= 9. They do not work with Java 10.
22-
{{site.data.alerts.end}}
23-
2422
## Step 1. Install the Java JDBC driver
2523

2624
Download and set up the Java JDBC driver as described in the [official documentation](https://jdbc.postgresql.org/documentation/head/setup.html).
2725

26+
{% include {{page.version.version}}/app/jdbc-version-note.md %}
27+
2828
<section class="filter-content" markdown="1" data-scope="secure">
2929

3030
## Step 2. Create the `maxroach` user and `bank` database
@@ -35,7 +35,7 @@ Download and set up the Java JDBC driver as described in the [official documenta
3535

3636
Create a certificate and key for the `maxroach` user by running the following command. The code samples will run as this user.
3737

38-
<span class="version-tag">New in v19.1</span>: You can pass the [`--also-generate-pkcs8-key` flag](cockroach-cert.html#flag-pkcs8) to generate a key in [PKCS#8 format](https://tools.ietf.org/html/rfc5208), which is the standard key encoding format in Java. In this case, the generated PKCS8 key will be named `client.maxroach.key.pk8`.
38+
You can pass the [`--also-generate-pkcs8-key` flag](cockroach-cert.html#flag-pkcs8) to generate a key in [PKCS#8 format](https://tools.ietf.org/html/rfc5208), which is the standard key encoding format in Java. In this case, the generated PKCS8 key will be named `client.maxroach.key.pk8`.
3939

4040
{% include copy-clipboard.html %}
4141
~~~ shell
@@ -64,7 +64,7 @@ It does all of the above using the practices we recommend for using JDBC with Co
6464

6565
To run it:
6666

67-
1. Download [`BasicExample.java`](https://github.com/raw/cockroachdb/docs/master/_includes/v19.1/app/BasicExample.java), or create the file yourself and copy the code below.
67+
1. Download [`BasicExample.java`](https://github.com/raw/cockroachdb/docs/master/_includes/{{page.version.version}}/app/BasicExample.java), or create the file yourself and copy the code below.
6868
2. Compile and run the code (adding the PostgreSQL JDBC driver to your classpath):
6969

7070
{% include copy-clipboard.html %}
@@ -83,7 +83,7 @@ To clone a version of the code below that connects to insecure clusters, run the
8383
`git clone https://github.com/cockroachlabs/hello-world-java-jdbc/`
8484
{{site.data.alerts.end}}
8585

86-
The contents of [`BasicExample.java`](https://github.com/raw/cockroachdb/docs/master/_includes/v19.1/app/BasicExample.java):
86+
The contents of [`BasicExample.java`](https://github.com/raw/cockroachdb/docs/master/_includes/{{page.version.version}}/app/BasicExample.java):
8787

8888
{% include copy-clipboard.html %}
8989
~~~ java
@@ -138,7 +138,7 @@ To run it:
138138
$ java -classpath .:/path/to/postgresql.jar BasicExample
139139
~~~
140140

141-
The contents of [`BasicExample.java`](https://github.com/raw/cockroachdb/docs/master/_includes/v19.1/app/insecure/BasicExample.java):
141+
The contents of [`BasicExample.java`](https://github.com/raw/cockroachdb/docs/master/_includes/{{page.version.version}}/app/insecure/BasicExample.java):
142142

143143
{% include copy-clipboard.html %}
144144
~~~ java

v19.2/install-client-drivers.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ For instructions on using peewee with CockroachDB, see the [CockroachDatabase pe
129129

130130
<section class="filter-content" markdown="1" data-scope="java">
131131

132+
{% include {{page.version.version}}/app/java-version-note.md %}
133+
132134
## Drivers
133135

134136
### JDBC
@@ -137,6 +139,8 @@ For instructions on using peewee with CockroachDB, see the [CockroachDatabase pe
137139

138140
Download and set up the Java JDBC driver as described in the [official documentation](https://jdbc.postgresql.org/documentation/head/setup.html).
139141

142+
{% include {{page.version.version}}/app/jdbc-version-note.md %}
143+
140144
For a simple but complete "Hello World" example app, see [Build a Java App with CockroachDB and JDBC](build-a-java-app-with-cockroachdb.html).
141145

142146
## ORMs

v20.1/build-a-java-app-with-cockroachdb-hibernate.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,18 @@ twitter: false
1414

1515
This tutorial shows you how build a simple Java application with CockroachDB and the Hibernate ORM.
1616

17+
{% include {{page.version.version}}/app/java-version-note.md %}
18+
1719
{{site.data.alerts.callout_success}}
1820
For a sample app and tutorial that uses Spring Data JPA (Hibernate) and CockroachDB, see [Build a Spring App with CockroachDB and JPA](build-a-spring-app-with-cockroachdb-jpa.html).
1921

2022
For another use of Hibernate with CockroachDB, see our [`examples-orms`](https://github.com/cockroachdb/examples-orms) repository.
2123
{{site.data.alerts.end}}
2224

23-
{{site.data.alerts.callout_info}}
24-
For Java applications that use the Spring framework, see the applications listed under [Java/Spring](build-a-spring-app-with-cockroachdb-mybatis.html).
25-
{{site.data.alerts.end}}
26-
2725
## Before you begin
2826

2927
{% include {{page.version.version}}/app/before-you-begin.md %}
3028

31-
{{site.data.alerts.callout_danger}}
32-
The examples on this page assume you are using a Java version <= 9. They do not work with Java 10.
33-
{{site.data.alerts.end}}
34-
3529
## Step 1. Install the Gradle build tool
3630

3731
This tutorial uses the [Gradle build tool](https://gradle.org/) to get all dependencies for your application, including Hibernate.

v20.1/build-a-java-app-with-cockroachdb-jooq.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,12 @@ This tutorial shows you how build a simple Java application with CockroachDB and
1616

1717
CockroachDB is supported in jOOQ [Professional and Enterprise editions](https://www.jooq.org/download/#databases).
1818

19+
{% include {{page.version.version}}/app/java-version-note.md %}
20+
1921
{{site.data.alerts.callout_success}}
2022
For another use of jOOQ with CockroachDB, see our [`examples-orms`](https://github.com/cockroachdb/examples-orms) repository.
2123
{{site.data.alerts.end}}
2224

23-
{{site.data.alerts.callout_info}}
24-
For Java applications that use the Spring framework, see the applications listed under [Java/Spring](build-a-spring-app-with-cockroachdb-mybatis.html).
25-
{{site.data.alerts.end}}
26-
2725
## Before you begin
2826

2927
{% include {{page.version.version}}/app/before-you-begin.md %}
@@ -52,10 +50,6 @@ For other ways to install Maven, see [its official documentation](https://maven.
5250

5351
Download the free trial of jOOQ Professional or Enterprise edition from [jOOQ's website](https://www.jooq.org/download), and unzip the file.
5452

55-
{{site.data.alerts.callout_info}}
56-
If you have Java 6, Java 8, or Java 11, go to [Download your jOOQ version](https://www.jooq.org/download/versions#trial), and download the free trial of jOOQ for your version of Java.
57-
{{site.data.alerts.end}}
58-
5953
To install jOOQ to your machine's local Maven repository, run the `maven-install.sh` script included in the jOOQ install folder:
6054

6155
{% include copy-clipboard.html %}

v20.1/build-a-java-app-with-cockroachdb.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ twitter: false
1414

1515
This tutorial shows you how to build a simple Java application with CockroachDB and the Java JDBC driver.
1616

17+
{% include {{page.version.version}}/app/java-version-note.md %}
18+
1719
{{site.data.alerts.callout_success}}
1820
For a sample app and tutorial that uses Spring Data JDBC and CockroachDB, see [Build a Spring App with CockroachDB and JDBC](build-a-spring-app-with-cockroachdb-jdbc.html).
1921
{{site.data.alerts.end}}
@@ -22,14 +24,12 @@ For a sample app and tutorial that uses Spring Data JDBC and CockroachDB, see [B
2224

2325
{% include {{page.version.version}}/app/before-you-begin.md %}
2426

25-
{{site.data.alerts.callout_danger}}
26-
The examples on this page assume you are using a Java version <= 9. They do not work with Java 10.
27-
{{site.data.alerts.end}}
28-
2927
## Step 1. Install the Java JDBC driver
3028

3129
Download and set up the Java JDBC driver as described in the [official documentation](https://jdbc.postgresql.org/documentation/head/setup.html).
3230

31+
{% include {{page.version.version}}/app/jdbc-version-note.md %}
32+
3333
<section class="filter-content" markdown="1" data-scope="secure">
3434

3535
## Step 2. Create the `maxroach` user and `bank` database

v20.1/install-client-drivers.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,16 @@ For instructions on using peewee with CockroachDB, see the [CockroachDatabase pe
130130

131131
## Drivers
132132

133+
{% include {{page.version.version}}/app/java-version-note.md %}
134+
133135
### JDBC
134136

135137
**Support level:** Full
136138

137139
Download and set up the Java JDBC driver as described in the [official documentation](https://jdbc.postgresql.org/documentation/head/setup.html).
138140

141+
{% include {{page.version.version}}/app/jdbc-version-note.md %}
142+
139143
For a simple but complete "Hello World" example app, see [Build a Java App with CockroachDB and JDBC](build-a-java-app-with-cockroachdb.html).
140144

141145
## ORMs

v20.2/build-a-java-app-with-cockroachdb-hibernate.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ twitter: false
1414

1515
This tutorial shows you how build a simple Java application with CockroachDB and the Hibernate ORM.
1616

17+
{% include {{page.version.version}}/app/java-version-note.md %}
18+
1719
{{site.data.alerts.callout_success}}
1820
For a sample app and tutorial that uses Spring Data JPA (Hibernate) and CockroachDB, see [Build a Spring App with CockroachDB and JPA](build-a-spring-app-with-cockroachdb-jpa.html).
1921

@@ -24,10 +26,6 @@ For another use of Hibernate with CockroachDB, see our [`examples-orms`](https:/
2426

2527
{% include {{page.version.version}}/app/before-you-begin.md %}
2628

27-
{{site.data.alerts.callout_danger}}
28-
The examples on this page assume you are using a Java version <= 9. They do not work with Java 10.
29-
{{site.data.alerts.end}}
30-
3129
## Step 1. Install the Gradle build tool
3230

3331
This tutorial uses the [Gradle build tool](https://gradle.org/) to get all dependencies for your application, including Hibernate.

v20.2/build-a-java-app-with-cockroachdb-jooq.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ This tutorial shows you how build a simple Java application with CockroachDB and
1616

1717
CockroachDB is supported in jOOQ [Professional and Enterprise editions](https://www.jooq.org/download/#databases).
1818

19+
{% include {{page.version.version}}/app/java-version-note.md %}
20+
1921
{{site.data.alerts.callout_success}}
2022
For another use of jOOQ with CockroachDB, see our [`examples-orms`](https://github.com/cockroachdb/examples-orms) repository.
2123
{{site.data.alerts.end}}
@@ -48,10 +50,6 @@ For other ways to install Maven, see [its official documentation](https://maven.
4850

4951
Download the free trial of jOOQ Professional or Enterprise edition from [jOOQ's website](https://www.jooq.org/download), and unzip the file.
5052

51-
{{site.data.alerts.callout_info}}
52-
If you have Java 6, Java 8, or Java 11, go to [Download your jOOQ version](https://www.jooq.org/download/versions#trial), and download the free trial of jOOQ for your version of Java.
53-
{{site.data.alerts.end}}
54-
5553
To install jOOQ to your machine's local Maven repository, run the `maven-install.sh` script included in the jOOQ install folder:
5654

5755
{% include copy-clipboard.html %}

v20.2/build-a-java-app-with-cockroachdb.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ twitter: false
1414

1515
This tutorial shows you how to build a simple Java application with CockroachDB and the Java JDBC driver.
1616

17+
{% include {{page.version.version}}/app/java-version-note.md %}
18+
1719
{{site.data.alerts.callout_success}}
1820
For a sample app and tutorial that uses Spring Data JDBC and CockroachDB, see [Build a Spring App with CockroachDB and JDBC](build-a-spring-app-with-cockroachdb-jdbc.html).
1921
{{site.data.alerts.end}}
@@ -22,14 +24,12 @@ For a sample app and tutorial that uses Spring Data JDBC and CockroachDB, see [B
2224

2325
{% include {{page.version.version}}/app/before-you-begin.md %}
2426

25-
{{site.data.alerts.callout_danger}}
26-
The examples on this page assume you are using a Java version <= 9. They do not work with Java 10.
27-
{{site.data.alerts.end}}
28-
2927
## Step 1. Install the Java JDBC driver
3028

3129
Download and set up the Java JDBC driver as described in the [official documentation](https://jdbc.postgresql.org/documentation/head/setup.html).
3230

31+
{% include {{page.version.version}}/app/jdbc-version-note.md %}
32+
3333
<section class="filter-content" markdown="1" data-scope="secure">
3434

3535
## Step 2. Create the `maxroach` user and `bank` database

v20.2/install-client-drivers.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ For instructions on using peewee with CockroachDB, see the [CockroachDatabase pe
128128

129129
<section class="filter-content" markdown="1" data-scope="java">
130130

131+
{% include {{page.version.version}}/app/java-version-note.md %}
132+
131133
## Drivers
132134

133135
### JDBC
@@ -136,6 +138,8 @@ For instructions on using peewee with CockroachDB, see the [CockroachDatabase pe
136138

137139
Download and set up the Java JDBC driver as described in the [official documentation](https://jdbc.postgresql.org/documentation/head/setup.html).
138140

141+
{% include {{page.version.version}}/app/jdbc-version-note.md %}
142+
139143
For a simple but complete "Hello World" example app, see [Build a Java App with CockroachDB and JDBC](build-a-java-app-with-cockroachdb.html).
140144

141145
## ORMs

0 commit comments

Comments
 (0)