Skip to content

Commit 21f71a4

Browse files
committed
Use the same db schema in all examples (demo)
1 parent 4229700 commit 21f71a4

File tree

12 files changed

+23
-23
lines changed

12 files changed

+23
-23
lines changed

jdbc/mariadb-pool/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ Change `Service` constructor to use a `MariaDbPoolDataSource` and run the app ag
2323
Prepare the database:
2424

2525
```sql
26-
CREATE DATABASE jdbc_demo;
26+
CREATE DATABASE demo;
2727
CREATE USER 'user'@'%';
28-
GRANT ALL ON jdbc_demo.* TO 'user'@'%' IDENTIFIED BY 'password';
28+
GRANT ALL ON demo.* TO 'user'@'%' IDENTIFIED BY 'password';
2929
FLUSH PRIVILEGES;
3030

31-
USE jdbc_demo;
31+
USE demo;
3232
CREATE TABLE programming_language(
3333
name VARCHAR(50) NOT NULL UNIQUE,
3434
rating INT

jdbc/mariadb-pool/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<dependency>
1616
<groupId>org.mariadb.jdbc</groupId>
1717
<artifactId>mariadb-java-client</artifactId>
18-
<version>2.7.4</version>
18+
<version>3.1.2</version>
1919
</dependency>
2020
</dependencies>
2121

jdbc/mariadb-pool/src/main/java/com/example/Service.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ private Service() throws SQLException {
4141
* MariaDbPoolDataSource dataSource = new MariaDbPoolDataSource();
4242
* That should work!
4343
*/
44-
dataSource.setUrl("jdbc:mariadb://localhost:3306/jdbc_demo");
44+
dataSource.setUrl("jdbc:mariadb://localhost:3306/demo");
4545
dataSource.setUser("user");
4646
dataSource.setPassword("password");
4747
this.dataSource = dataSource;
4848
/*
4949
* If you are using MariaDB SkySQL (https://mariadb.com/products/skysql),
5050
* enable SSL and specify the path to the CA chain file that you can download
5151
* from the SkySQL Portal (https://cloud.mariadb.com):
52-
* jdbc:mariadb://demo-db0000xxxx.mdb000xxxx.db.skysql.net:5047/jdbc_demo?useSsl=true&
52+
* jdbc:mariadb://demo-db0000xxxx.mdb000xxxx.db.skysql.net:5047/demo?useSsl=true&
5353
* serverSslCert=/path/to/your/skysql_chain.pem
5454
*/
5555
}

jdbc/part1/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ connection.close();
5151
Prepare the database:
5252

5353
```sql
54-
CREATE DATABASE jdbc_demo;
54+
CREATE DATABASE demo;
5555
CREATE USER 'user'@'%';
56-
GRANT ALL ON jdbc_demo.* TO 'user'@'%' IDENTIFIED BY 'password';
56+
GRANT ALL ON demo.* TO 'user'@'%' IDENTIFIED BY 'password';
5757
FLUSH PRIVILEGES;
5858
```
5959

jdbc/part1/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<dependency>
2020
<groupId>org.mariadb.jdbc</groupId>
2121
<artifactId>mariadb-java-client</artifactId>
22-
<version>2.7.4</version>
22+
<version>3.1.2</version>
2323
</dependency>
2424
</dependencies>
2525

jdbc/part1/src/main/java/com/example/Application.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ public static void main(String[] args) throws SQLException {
2828
private static void initDatabaseConnection() throws SQLException {
2929
System.out.println("Connecting to the database...");
3030
connection = DriverManager.getConnection(
31-
"jdbc:mariadb://localhost:3306/jdbc_demo",
31+
"jdbc:mariadb://localhost:3306/demo",
3232
"user", "password");
3333
System.out.println("Connection valid: " + connection.isValid(5));
3434
/*
3535
If you are using MariaDB SkySQL (https://mariadb.com/products/skysql),
3636
enable SSL and specify the path to the CA chain file that you can download
3737
from the SkySQL Portal (https://cloud.mariadb.com):
38-
jdbc:mariadb://demo-db0000xxxx.mdb000xxxx.db.skysql.net:5047/jdbc_demo?useSsl=true&serverSslCert=/path/to/your/skysql_chain.pem
38+
jdbc:mariadb://demo-db0000xxxx.mdb000xxxx.db.skysql.net:5047/demo?useSsl=true&serverSslCert=/path/to/your/skysql_chain.pem
3939
*/
4040
}
4141

jdbc/part2/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ try (PreparedStatement statement = connection.prepareStatement("""
4949
Prepare the database:
5050

5151
```sql
52-
CREATE DATABASE jdbc_demo;
52+
CREATE DATABASE demo;
5353
CREATE USER 'user'@'%';
54-
GRANT ALL ON jdbc_demo.* TO 'user'@'%' IDENTIFIED BY 'password';
54+
GRANT ALL ON demo.* TO 'user'@'%' IDENTIFIED BY 'password';
5555
FLUSH PRIVILEGES;
5656

57-
USE jdbc_demo;
57+
USE demo;
5858
CREATE TABLE programming_language(
5959
name VARCHAR(50) NOT NULL UNIQUE,
6060
rating INT

jdbc/part2/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<dependency>
2020
<groupId>org.mariadb.jdbc</groupId>
2121
<artifactId>mariadb-java-client</artifactId>
22-
<version>2.7.4</version>
22+
<version>3.1.2</version>
2323
</dependency>
2424
</dependencies>
2525

jdbc/part2/src/main/java/com/example/Application.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,14 @@ private static void deleteData(String nameExpression) throws SQLException {
9999
private static void initDatabaseConnection() throws SQLException {
100100
System.out.println("Connecting to the database...");
101101
connection = DriverManager.getConnection(
102-
"jdbc:mariadb://localhost:3306/jdbc_demo",
102+
"jdbc:mariadb://localhost:3306/demo",
103103
"user", "password");
104104
System.out.println("Connection valid: " + connection.isValid(5));
105105
/*
106106
* If you are using MariaDB SkySQL (https://mariadb.com/products/skysql),
107107
* enable SSL and specify the path to the CA chain file that you can download
108108
* from the SkySQL Portal (https://cloud.mariadb.com):
109-
* jdbc:mariadb://demo-db0000xxxx.mdb000xxxx.db.skysql.net:5047/jdbc_demo?useSsl=true&
109+
* jdbc:mariadb://demo-db0000xxxx.mdb000xxxx.db.skysql.net:5047/demo?useSsl=true&
110110
* serverSslCert=/path/to/your/skysql_chain.pem
111111
*/
112112
}

jdbc/part3/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@ dataSource.close();
6363
Prepare the database:
6464

6565
```sql
66-
CREATE DATABASE jdbc_demo;
66+
CREATE DATABASE demo;
6767
CREATE USER 'user'@'%';
68-
GRANT ALL ON jdbc_demo.* TO 'user'@'%' IDENTIFIED BY 'password';
68+
GRANT ALL ON demo.* TO 'user'@'%' IDENTIFIED BY 'password';
6969
FLUSH PRIVILEGES;
7070

71-
USE jdbc_demo;
71+
USE demo;
7272
CREATE TABLE programming_language(
7373
name VARCHAR(50) NOT NULL UNIQUE,
7474
rating INT

jdbc/part3/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<dependency>
2020
<groupId>org.mariadb.jdbc</groupId>
2121
<artifactId>mariadb-java-client</artifactId>
22-
<version>2.7.4</version>
22+
<version>3.1.2</version>
2323
</dependency>
2424

2525
<!-- Connection pool -->
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# HikariCP database connection pool configuration
2-
jdbcUrl=jdbc:mariadb://localhost:3306/jdbc_demo
2+
jdbcUrl=jdbc:mariadb://localhost:3306/demo
33
dataSource.username=user
44
dataSource.password=password
55

66
# If you are using MariaDB SkySQL (https://mariadb.com/products/skysql),
77
# enable SSL and specify the path to the CA chain file that you can download
88
# from the SkySQL Portal (https://cloud.mariadb.com):
99
#
10-
# jdbc:mariadb://demo-db0000xxxx.mdb000xxxx.db.skysql.net:5047/jdbc_demo?useSsl=true&serverSslCert=/path/to/your/skysql_chain.pem
10+
# jdbc:mariadb://demo-db0000xxxx.mdb000xxxx.db.skysql.net:5047/demo?useSsl=true&serverSslCert=/path/to/your/skysql_chain.pem

0 commit comments

Comments
 (0)