Updated JDBC connection string for Database connection

- Updated SSL setting
- Due to a weard bug with MySQL in Docker in WSL (Windows), added allowPublicKeyRetrieval=true
This commit is contained in:
Marc Baloup 2024-10-02 00:05:35 +02:00
parent 36eb1227cf
commit e6b77bcad6
2 changed files with 6 additions and 3 deletions

View File

@ -67,7 +67,8 @@
"1.20.4": 765, "1.20.4": 765,
"1.20.5": 766, "1.20.5": 766,
"1.20.6": 766, "1.20.6": 766,
"1.21": 767 "1.21": 767,
"1.21.1": 767
}, },
"versionsOfProtocol": { "versionsOfProtocol": {
"4": [ "4": [
@ -220,7 +221,8 @@
"1.20.6" "1.20.6"
], ],
"767": [ "767": [
"1.21" "1.21",
"1.21.1"
] ]
} }
} }

View File

@ -23,7 +23,8 @@ public class DBConnection {
public DBConnection(String host, int port, String dbname, String login, String password) { public DBConnection(String host, int port, String dbname, String login, String password) {
this("jdbc:mysql://" + host + ":" + port + "/" + dbname this("jdbc:mysql://" + host + ":" + port + "/" + dbname
+ "?useUnicode=true" + "?useUnicode=true"
+ "&useSSL=false" + "&sslMode=DISABLED"
+ "&allowPublicKeyRetrieval=true"
+ "&characterEncoding=utf8" + "&characterEncoding=utf8"
+ "&characterSetResults=utf8" + "&characterSetResults=utf8"
+ "&character_set_server=utf8mb4" + "&character_set_server=utf8mb4"