Skip to content

Commit 306ce04

Browse files
author
litongjava
committed
change to JDBC_URL
1 parent af916c5 commit 306ce04

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

frameworks/Java/tio-server/README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,20 +78,24 @@ All implementations use the same URLs.
7878
```
7979
The run is to specify the mysql database
8080
```
81-
docker run --rm -p 8080:8080 tio-server-benchmark --jdbc.url=jdbc:mysql://192.168.3.9/hello_world --jdbc.user=root --jdbc.pswd=robot_123456#
81+
docker run --rm -p 8080:8080 \
82+
-e JDBC_URL="jdbc:mysql://192.168.3.9/hello_world" \
83+
-e JDBC_USER="root" \
84+
-e JDBC_PSWD="robot_123456" \
85+
tio-server-benchmark
8286
```
8387

8488
### windows
8589

8690
-windows
8791
```
88-
D:\java\jdk1.8.0_121\bin\java -jar target\tio-server-benchmark-1.0.jar --jdbc.url=jdbc:mysql://192.168.3.9/hello_world --jdbc.user=root --jdbc.pswd=robot_123456#
92+
D:\java\jdk1.8.0_121\bin\java -jar target\tio-server-benchmark-1.0.jar --JDBC_URL=jdbc:mysql://192.168.3.9/hello_world --jdbc.user=root --JDBC_PSWD=robot_123456#
8993
```
9094
or
9195
```
92-
set jdbc.url=jdbc:mysql://192.168.3.9/hello_world
96+
set JDBC_URL=jdbc:mysql://192.168.3.9/hello_world
9397
set jdbc.user=root
94-
set jdbc.pswd=robot_123456#
98+
set JDBC_PSWD=robot_123456#
9599
D:\java\jdk1.8.0_121\bin\java -jar target\tio-server-benchmark-1.0.jar
96100
```
97101

frameworks/Java/tio-server/src/main/java/com/litongjava/tio/http/server/config/MysqlDbConfig.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ public class MysqlDbConfig {
99

1010
public void init() {
1111
// start active recored
12-
String jdbcUrl = EnviormentUtils.get("jdbc.url");
12+
String jdbcUrl = EnviormentUtils.get("JDBC_URL");
1313
// String jdbcUrl = "jdbc:mysql://192.168.3.9/hello_world";
1414

15-
String jdbcUser = EnviormentUtils.get("jdbc.user");
15+
String jdbcUser = EnviormentUtils.get("JDBC_USER");
1616
// String jdbcUser = "root";
1717

18-
String jdbcPswd = EnviormentUtils.get("jdbc.pswd");
18+
String jdbcPswd = EnviormentUtils.get("JDBC_PSWD");
1919
// String jdbcPswd = "robot_123456#";
2020
HikariCpPlugin hikariCpPlugin = new HikariCpPlugin(jdbcUrl, jdbcUser, jdbcPswd);
2121

0 commit comments

Comments
 (0)