Skip to content

Commit dcce170

Browse files
committed
Connect/Java: Reorganize JDBC pages
1 parent 0fff874 commit dcce170

File tree

2 files changed

+49
-40
lines changed

2 files changed

+49
-40
lines changed

docs/connect/java/cratedb-jdbc.md

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -61,26 +61,6 @@ void main() throws SQLException {
6161
}
6262
```
6363

64-
:::{include} ../_cratedb.md
65-
:::
66-
Download JAR file.
67-
```shell
68-
wget https://repo1.maven.org/maven2/io/crate/crate-jdbc-standalone/2.7.0/crate-jdbc-standalone-2.7.0.jar
69-
```
70-
:::{dropdown} Instructions for Windows users
71-
If you don't have the `wget` program installed, for example on Windows, just
72-
download the JAR file using your web browser of choice.
73-
If you want to use PowerShell, invoke the `Invoke-WebRequest` command instead
74-
of `wget`.
75-
```powershell
76-
Invoke-WebRequest https://repo1.maven.org/maven2/io/crate/crate-jdbc-standalone/2.7.0/crate-jdbc-standalone-2.7.0.jar -OutFile crate-jdbc-standalone-2.7.0.jar
77-
```
78-
:::
79-
Invoke program. Needs Java >= 21 ([JEP 445]), alternatively see [](#full-example).
80-
```shell
81-
java -cp crate-jdbc-standalone-2.7.0.jar example.java
82-
```
83-
8464
:::{rubric} CrateDB Cloud
8565
:::
8666

@@ -138,6 +118,31 @@ dependencies {
138118
}
139119
```
140120

121+
## Quickstart example
122+
123+
Create a file `example.java` including the synopsis code shared above.
124+
125+
:::{include} ../_cratedb.md
126+
:::
127+
Download JAR file.
128+
```shell
129+
wget https://repo1.maven.org/maven2/io/crate/crate-jdbc-standalone/2.7.0/crate-jdbc-standalone-2.7.0.jar
130+
```
131+
:::{dropdown} Instructions for Windows users
132+
If you don't have the `wget` program installed, for example on Windows, just
133+
download the JAR file using your web browser of choice.
134+
If you want to use PowerShell, invoke the `Invoke-WebRequest` command instead
135+
of `wget`.
136+
```powershell
137+
Invoke-WebRequest https://repo1.maven.org/maven2/io/crate/crate-jdbc-standalone/2.7.0/crate-jdbc-standalone-2.7.0.jar -OutFile crate-jdbc-standalone-2.7.0.jar
138+
```
139+
:::
140+
Invoke program. Needs Java >= 21 ([JEP 445]), alternatively see [](#full-example).
141+
```shell
142+
java -cp crate-jdbc-standalone-2.7.0.jar example.java
143+
```
144+
145+
141146
## Full example
142147

143148
:::{include} _jdbc_example.md

docs/connect/java/postgresql-jdbc.md

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -61,26 +61,6 @@ void main() throws SQLException {
6161
}
6262
```
6363

64-
:::{include} ../_cratedb.md
65-
:::
66-
Download JAR file.
67-
```shell
68-
wget https://repo1.maven.org/maven2/org/postgresql/postgresql/42.7.8/postgresql-42.7.8.jar
69-
```
70-
:::{dropdown} Instructions for Windows users
71-
If you don't have the `wget` program installed, for example on Windows, just
72-
download the JAR file using your web browser of choice.
73-
If you want to use PowerShell, invoke the `Invoke-WebRequest` command instead
74-
of `wget`.
75-
```powershell
76-
Invoke-WebRequest https://repo1.maven.org/maven2/org/postgresql/postgresql/42.7.8/postgresql-42.7.8.jar -OutFile postgresql-42.7.8.jar
77-
```
78-
:::
79-
Invoke program. Needs Java >= 21 ([JEP 445]), alternatively see [](#full-example).
80-
```shell
81-
java -cp postgresql-42.7.8.jar example.java
82-
```
83-
8464
:::{rubric} CrateDB Cloud
8565
:::
8666

@@ -136,6 +116,30 @@ dependencies {
136116
}
137117
```
138118

119+
## Quickstart example
120+
121+
Create a file `example.java` including the synopsis code shared above.
122+
123+
:::{include} ../_cratedb.md
124+
:::
125+
Download JAR file.
126+
```shell
127+
wget https://repo1.maven.org/maven2/org/postgresql/postgresql/42.7.8/postgresql-42.7.8.jar
128+
```
129+
:::{dropdown} Instructions for Windows users
130+
If you don't have the `wget` program installed, for example on Windows, just
131+
download the JAR file using your web browser of choice.
132+
If you want to use PowerShell, invoke the `Invoke-WebRequest` command instead
133+
of `wget`.
134+
```powershell
135+
Invoke-WebRequest https://repo1.maven.org/maven2/org/postgresql/postgresql/42.7.8/postgresql-42.7.8.jar -OutFile postgresql-42.7.8.jar
136+
```
137+
:::
138+
Invoke program. Needs Java >= 21 ([JEP 445]), alternatively see [](#full-example).
139+
```shell
140+
java -cp postgresql-42.7.8.jar example.java
141+
```
142+
139143
## Full example
140144

141145
:::{include} _jdbc_example.md

0 commit comments

Comments
 (0)